2 * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
\r
5 * ============LICENSE_START=======================================================
\r
7 * ================================================================================
\r
8 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
9 * ================================================================================
\r
10 * Licensed under the Apache License, Version 2.0 (the "License");
\r
11 * you may not use this file except in compliance with the License.
\r
12 * You may obtain a copy of the License at
\r
14 * http://www.apache.org/licenses/LICENSE-2.0
\r
16 * Unless required by applicable law or agreed to in writing, software
\r
17 * distributed under the License is distributed on an "AS IS" BASIS,
\r
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
19 * See the License for the specific language governing permissions and
\r
20 * limitations under the License.
\r
21 * ============LICENSE_END=========================================================
\r
24 package org.openecomp.mso.bpmn.mock;
\r
26 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
\r
27 import static com.github.tomakehurst.wiremock.client.WireMock.containing;
\r
28 import static com.github.tomakehurst.wiremock.client.WireMock.delete;
\r
29 import static com.github.tomakehurst.wiremock.client.WireMock.get;
\r
30 import static com.github.tomakehurst.wiremock.client.WireMock.post;
\r
31 import static com.github.tomakehurst.wiremock.client.WireMock.patch;
\r
32 import static com.github.tomakehurst.wiremock.client.WireMock.put;
\r
33 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
\r
34 import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
\r
35 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
\r
38 * Reusable Mock StubResponses for Policy
\r
41 public class StubResponsePolicy {
\r
43 public static void setupAllMocks() {
\r
47 // start of Policy mocks
\r
48 public static void MockPolicyAbort() {
\r
49 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
50 .withRequestBody(containing("BB1"))
\r
51 .willReturn(aResponse()
\r
53 .withHeader("Content-Type", "application/json")
\r
54 .withBodyFile("policyAbortResponse.json")));
\r
56 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
57 .withRequestBody(containing("UPDVnfI"))
\r
58 .willReturn(aResponse()
\r
60 .withHeader("Content-Type", "application/json")
\r
61 .withBodyFile("policyAbortResponse.json")));
\r
63 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
64 .withRequestBody(containing("RPLVnfI"))
\r
65 .willReturn(aResponse()
\r
67 .withHeader("Content-Type", "application/json")
\r
68 .withBodyFile("policyAbortResponse.json")));
\r
73 public static void MockPolicySkip() {
\r
74 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
75 .withRequestBody(containing("BB1"))
\r
76 .willReturn(aResponse()
\r
78 .withHeader("Content-Type", "application/json")
\r
79 .withBodyFile("Policy/policySkipResponse.json")));
\r
81 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
82 .withRequestBody(containing("UPDVnfI"))
\r
83 .willReturn(aResponse()
\r
85 .withHeader("Content-Type", "application/json")
\r
86 .withBodyFile("Policy/policySkipResponse.json")));
\r
88 stubFor(post(urlEqualTo("/pdp/api/getDecision"))
\r
89 .withRequestBody(containing("RPLVnfI"))
\r
90 .willReturn(aResponse()
\r
92 .withHeader("Content-Type", "application/json")
\r
93 .withBodyFile("Policy/policySkipResponse.json")));
\r