Passing Instance params for SO Macro request
[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 * configure readTimeout = 10000
26 * call Context.startServers();
27     
28 Scenario: testHealthCheck
29 Given path 'status'
30 When method get
31 Then status 200
32 And match response.status == 'ok'
33 And match response.name == 'nbi'
34
35 Scenario: testFullHealthCheck
36 Given path 'status'
37 And params {fullStatus :true}
38 When method get
39 Then status 200
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'}
44
45
46 Scenario: testFullHealthChecWithoutWiremock
47 * call Context.stopWiremock();
48 Given path 'status'
49 And params {fullStatus :true}
50 When method get
51 Then status 200
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'}
56
57 Scenario: testFullHealthCheckWithSDCNotResponding
58 * call Context.removeWireMockMapping("/sdc2/rest/healthCheck");
59 Given path 'status'
60 And params {fullStatus :true}
61 When method get
62 Then status 200
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'},]