Improve license scan result
[externalapi/nbi.git] / src / test / resources / karatetest / features / 04--StatusRessourceTest.feature
1 #
2 #     Copyright (c) 2018 Orange
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16
17 # new feature
18 # Tags: optional
19     
20 Feature: Status Resource
21
22 Background:
23 * url nbiBaseUrl
24 * def Context = Java.type('org.onap.nbi.test.Context');
25 * call Context.startServers();
26     
27 Scenario: testHealthCheck
28 Given path 'status'
29 When method get
30 Then status 200
31 And match response.status == 'ok'
32 And match response.name == 'nbi'
33
34 Scenario: testFullHealthCheck
35 Given path 'status'
36 And params {fullStatus :true}
37 When method get
38 Then status 200
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'}
43
44
45 Scenario: testFullHealthChecWithoutWiremock
46 * call Context.stopWiremock();
47 Given path 'status'
48 And params {fullStatus :true}
49 When method get
50 Then status 200
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'}
55
56 Scenario: testFullHealthCheckWithSDCNotResponding
57 * call Context.removeWireMockMapping("/sdc2/rest/healthCheck");
58 Given path 'status'
59 And params {fullStatus :true}
60 When method get
61 Then status 200
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'},]