-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcheck_service_health.http
36 lines (30 loc) · 1.51 KB
/
check_service_health.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
### Check About Details
# @name api-about-details
GET http://{{host}}/v1/about
Accept: application/json
> {%
client.test("Request executed successfully", function () {
client.assert(response.status === 200, "Response status is not 200");
});
%}
### Check API Stats
# @name api-stats
GET http://{{host}}/v1/stats
Accept: application/json
> {%
client.test("Request executed successfully", function () {
client.assert(response.status === 200, "Response status is not 200");
});
client.test("Response content-type is json", function() {
var type = response.contentType.mimeType;
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'");
});
client.test("Returns sensible numbers", function() {
var data = response.body;
client.assert(data.hasOwnProperty("facility_count"), "Response body does not contain 'facility_count' property");
client.assert(data.facility_count === 5, "Expected 'facility_count' to be 3 but received '" + data.facility_count + "'");
client.assert(data.proposal_count > 0, "Expected 'proposal_count' to be greater than 0 but received '" + data.proposal_count + "'");
client.assert(data.commissioning_proposal_count > 0, "Expected 'commissioning_proposal_count' to be greater than 0 but received '" + data.proposal_count + "'");
client.assert(data.beamline_count > 0, "Expected 'beamline_count' to be greater than 0 but received '" + data.proposal_count + "'");
});
%}