2 # Copyright (c) 2018 Orange
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 Feature: Status Resource
24 * def Context = Java.type('org.onap.nbi.test.Context');
25 * configure readTimeout = 10000
26 * call Context.startServers();
28 Scenario: testHealthCheck
32 And match response.status == 'ok'
33 And match response.name == 'nbi'
35 Scenario: testFullHealthCheck
37 And params {fullStatus :true}
40 And match response.status == 'ok'
41 And match response.name == 'nbi'
42 And assert response.components.length == 4
43 And match each $.components contains {status :'ok'}
46 Scenario: testFullHealthChecWithoutWiremock
47 * call Context.stopWiremock();
49 And params {fullStatus :true}
52 And match response.status == 'ok'
53 And match response.name == 'nbi'
54 And assert response.components.length == 4
55 And match each response.components contains { status: 'ko'}
57 Scenario: testFullHealthCheckWithSDCNotResponding
58 * call Context.removeWireMockMapping("/sdc2/rest/healthCheck");
60 And params {fullStatus :true}
63 And match response.status == 'ok'
64 And match response.name == 'nbi'
65 And assert response.components.length == 4
66 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'},]