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 * call Context.startServers();
27 Scenario: testHealthCheck
31 And match response.status == 'ok'
32 And match response.name == 'nbi'
34 Scenario: testFullHealthCheck
36 And params {fullStatus :true}
39 And match response.status == 'ok'
40 And match response.name == 'nbi'
41 And assert response.components.length == 4
42 And match each $.components contains {status :'ok'}
45 Scenario: testFullHealthChecWithoutWiremock
46 * call Context.stopWiremock();
48 And params {fullStatus :true}
51 And match response.status == 'ok'
52 And match response.name == 'nbi'
53 And assert response.components.length == 4
54 And match each response.components contains { status: 'ko'}
56 Scenario: testFullHealthCheckWithSDCNotResponding
57 * call Context.removeWireMockMapping("/sdc2/rest/healthCheck");
59 And params {fullStatus :true}
62 And match response.status == 'ok'
63 And match response.name == 'nbi'
64 And assert response.components.length == 4
65 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'},]