Skip to content

Commit b53ddf3

Browse files
[PRM-495] Removed all health checks across JS services
1 parent 2904fce commit b53ddf3

File tree

16 files changed

+0
-530
lines changed

16 files changed

+0
-530
lines changed

services/ehr-out-service/src/__tests__/app.integration.test.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,6 @@ jest.mock('../services/gp2gp/send-core');
4444
jest.mock('../services/ehr-repo/get-fragment');
4545
jest.mock('../services/gp2gp/send-fragment');
4646

47-
describe('GET /health', () => {
48-
// ============ COMMON PROPERTIES ============
49-
const HEALTH_ENDPOINT = '/health';
50-
const { nhsEnvironment } = config();
51-
// =================== END ===================
52-
53-
it('should return 200 and the response from getHealthCheck', async () => {
54-
const expectedHealthCheckResponse = {
55-
version: '1',
56-
description: 'Health of ehr-out-service',
57-
nhsEnvironment: nhsEnvironment,
58-
details: {
59-
database: {
60-
type: 'dynamodb'
61-
}
62-
}
63-
};
64-
65-
const response = await request(app).get(HEALTH_ENDPOINT);
66-
67-
expect(response.statusCode).toBe(200);
68-
expect(response.body).toMatchObject(expectedHealthCheckResponse);
69-
});
70-
});
71-
7247
describe('Swagger Documentation', () => {
7348
// ============ COMMON PROPERTIES ============
7449
const SWAGGER_ENDPOINT_1 = '/swagger';

services/ehr-out-service/src/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import swaggerUi from 'swagger-ui-express';
33

44
import { middleware } from './middleware/logging';
55
import { registrationRequests } from './api/registration-request';
6-
import { healthCheck } from './api/health-check/health-check';
76
import swaggerDocument from './swagger.json';
87

98
const app = express();
109
app.use(express.json());
1110

1211
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
13-
app.use('/health', middleware, healthCheck);
1412
app.use('/registration-requests', middleware, registrationRequests);
1513

1614
// eslint-disable-next-line no-unused-vars

services/ehr-out-service/src/swagger.json

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,6 @@
66
"title": "ehr-out-service"
77
},
88
"paths": {
9-
"/health": {
10-
"get": {
11-
"tags": [
12-
"/health"
13-
],
14-
"summary": "Checks health of api",
15-
"produces": [
16-
"application/json"
17-
],
18-
"responses": {
19-
"200": {
20-
"description": "Successful retrieval",
21-
"schema": {
22-
"$ref": "#/definitions/healthCheckResponse"
23-
}
24-
},
25-
"500": {
26-
"description": "Error",
27-
"schema": {
28-
"$ref": "#/definitions/errorResponse"
29-
}
30-
}
31-
}
32-
}
33-
},
349
"/registration-requests/{conversationId}": {
3510
"get": {
3611
"tags": [
@@ -97,27 +72,6 @@
9772
}
9873
}
9974
}
100-
},
101-
"healthCheckResponse": {
102-
"type": "object",
103-
"properties": {
104-
"version": {
105-
"type": "string",
106-
"description": "Version number"
107-
},
108-
"description": {
109-
"type": "string",
110-
"description": "Describes the component"
111-
},
112-
"status": {
113-
"type": "string",
114-
"description": "Tells you if the service is running"
115-
},
116-
"nhsEnvironment": {
117-
"type": "string",
118-
"description": "Environment - test, dev etc."
119-
}
120-
}
12175
}
12276
}
12377
}

services/ehr-repo/src/__tests__/app.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import app from '../app';
33

44
jest.mock('../middleware/logging');
55
jest.mock('../middleware/auth');
6-
jest.mock('../services/health-check/get-health-check');
76

87
describe('app', () => {
98
describe('GET /', () => {

services/ehr-repo/src/api/health-check/__tests__/health-check.test.js

Lines changed: 0 additions & 187 deletions
This file was deleted.

services/ehr-repo/src/api/health-check/health-check.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

services/ehr-repo/src/app.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import swaggerUi from 'swagger-ui-express';
55
import { messages } from './api/messages';
66
import { patients } from './api/patients';
77
import { fragments } from './api/fragments';
8-
9-
import { healthCheck } from './api/health-check/health-check';
108
import { options } from './config/logging';
119
import * as logging from './middleware/logging';
1210
import swaggerDocument from './swagger.json';
@@ -30,7 +28,6 @@ app.use(requestLogger(options));
3028
app.use('/patients', logging.middleware, patients);
3129
app.use('/messages', logging.middleware, messages);
3230
app.use('/fragments', logging.middleware, fragments);
33-
app.use('/health', logging.middleware, healthCheck);
3431
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
3532
app.use(errorLogger(options));
3633

0 commit comments

Comments
 (0)