Improve nbi status
[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 * call Context.startServers();
40
41 Scenario: testFullHealthCheckWithSDCNotResponding
42 * call Context.removeWireMockMapping("/sdc/v1/artifactTypes");
43 Given path 'status'
44 And params {fullStatus :true}
45 When method get
46 Then status 200
47 And match response.status == 'ok'
48 And match response.name == 'nbi'
49 And assert response.components.length == 4
50 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'},]
51 * call Context.startServers();