Merge "Reorder modifiers"
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / openecomp / mso / bpmn / mock / StubResponsePolicy.java
1 /*
2  * ============LICENSE_START======================================================= 
3  * ONAP - SO 
4  * ================================================================================ 
5  * Licensed under the Apache License, Version 2.0 (the "License"); 
6  * you may not use this file except in compliance with the License. 
7  * You may obtain a copy of the License at 
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0 
10  * 
11  * Unless required by applicable law or agreed to in writing, software 
12  * distributed under the License is distributed on an "AS IS" BASIS, 
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
14  * See the License for the specific language governing permissions and 
15  * limitations under the License. 
16  * ============LICENSE_END========================================================= 
17  */ 
18
19 package org.openecomp.mso.bpmn.mock;
20
21 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
22 import static com.github.tomakehurst.wiremock.client.WireMock.containing;
23 import static com.github.tomakehurst.wiremock.client.WireMock.delete;
24 import static com.github.tomakehurst.wiremock.client.WireMock.get;
25 import static com.github.tomakehurst.wiremock.client.WireMock.post;
26 import static com.github.tomakehurst.wiremock.client.WireMock.patch;
27 import static com.github.tomakehurst.wiremock.client.WireMock.put;
28 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
29 import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
30 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
31
32 /**
33  * Reusable Mock StubResponses for Policy
34  *
35  */
36 public class StubResponsePolicy {
37
38         public static void setupAllMocks() {
39
40         }
41
42         // start of Policy mocks
43         public static void MockPolicyAbort() {          
44                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
45                         .withRequestBody(containing("BB1"))
46                         .willReturn(aResponse()
47                                 .withStatus(200)
48                                 .withHeader("Content-Type", "application/json")
49                                 .withBodyFile("policyAbortResponse.json")));
50                 
51                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
52                                 .withRequestBody(containing("UPDVnfI"))
53                                 .willReturn(aResponse()
54                                         .withStatus(200)
55                                         .withHeader("Content-Type", "application/json")
56                                         .withBodyFile("policyAbortResponse.json")));
57                 
58                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
59                                 .withRequestBody(containing("RPLVnfI"))
60                                 .willReturn(aResponse()
61                                         .withStatus(200)
62                                         .withHeader("Content-Type", "application/json")
63                                         .withBodyFile("policyAbortResponse.json")));
64                 
65                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
66                                 .withRequestBody(containing("VnfIPU"))
67                                 .willReturn(aResponse()
68                                         .withStatus(200)
69                                         .withHeader("Content-Type", "application/json")
70                                         .withBodyFile("policyAbortResponse.json")));
71                 
72                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
73                                 .withRequestBody(containing("VnfCU"))
74                                 .willReturn(aResponse()
75                                         .withStatus(200)
76                                         .withHeader("Content-Type", "application/json")
77                                         .withBodyFile("policyAbortResponse.json")));
78
79
80
81         }
82         
83         public static void MockPolicySkip() {           
84                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
85                         .withRequestBody(containing("BB1"))
86                         .willReturn(aResponse()
87                                 .withStatus(200)
88                                 .withHeader("Content-Type", "application/json")
89                                 .withBodyFile("Policy/policySkipResponse.json")));
90                 
91                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
92                                 .withRequestBody(containing("UPDVnfI"))
93                                 .willReturn(aResponse()
94                                         .withStatus(200)
95                                         .withHeader("Content-Type", "application/json")
96                                         .withBodyFile("Policy/policySkipResponse.json")));
97                 
98                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
99                                 .withRequestBody(containing("RPLVnfI"))
100                                 .willReturn(aResponse()
101                                         .withStatus(200)
102                                         .withHeader("Content-Type", "application/json")
103                                         .withBodyFile("Policy/policySkipResponse.json")));
104                 
105                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
106                                 .withRequestBody(containing("VnfIPU"))
107                                 .willReturn(aResponse()
108                                         .withStatus(200)
109                                         .withHeader("Content-Type", "application/json")
110                                         .withBodyFile("Policy/policySkipResponse.json")));
111                 
112                 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
113                                 .withRequestBody(containing("VnfCU"))
114                                 .willReturn(aResponse()
115                                         .withStatus(200)
116                                         .withHeader("Content-Type", "application/json")
117                                         .withBodyFile("Policy/policySkipResponse.json")));
118
119
120         }
121         
122         
123 }