a21b9b3946da4d8e7a8c340b1aec2ee120780c27
[externalapi/nbi.git] / src / test / resources / karatetest / features / 04--StatusRessourceTest.feature
1 # new feature
2 # Tags: optional
3     
4 Feature: Status Resource
5
6 Background:
7 * url nbiBaseUrl
8 * def Context = Java.type('org.onap.nbi.test.Context');
9 * call Context.startServers();
10     
11 Scenario: testHealthCheck
12 Given path 'status'
13 When method get
14 Then status 200
15 And match response.status == 'ok'
16 And match response.name == 'nbi'
17
18 Scenario: testFullHealthCheck
19 Given path 'status'
20 And params {fullStatus :true}
21 When method get
22 Then status 200
23 And match response.status == 'ok'
24 And match response.name == 'nbi'
25 And assert response.components.length == 4
26 And match each $.components contains {status :'ok'}
27
28
29 Scenario: testFullHealthChecWithoutWiremock
30 * call Context.stopWiremock();
31 Given path 'status'
32 And params {fullStatus :true}
33 When method get
34 Then status 200
35 And match response.status == 'ok'
36 And match response.name == 'nbi'
37 And assert response.components.length == 4
38 And match each response.components contains {  status: 'ko'}
39
40 Scenario: testFullHealthCheckWithSDCNotResponding
41 * call Context.removeWireMockMapping("/sdc2/rest/healthCheck");
42 Given path 'status'
43 And params {fullStatus :true}
44 When method get
45 Then status 200
46 And match response.status == 'ok'
47 And match response.name == 'nbi'
48 And assert response.components.length == 4
49 And match response.components contains [{name:'sdc connectivity', status: 'ko'},{name:'so connectivity', status: 'ok'},{name:'aai connectivity', status: 'ok'},{name:'dmaap connectivity', status: 'ok'},]