2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.bpmn.mock;
23 import static com.github.tomakehurst.wiremock.client.WireMock.*;
24 import static com.github.tomakehurst.wiremock.client.WireMock.containing;
25 import static com.github.tomakehurst.wiremock.client.WireMock.delete;
26 import static com.github.tomakehurst.wiremock.client.WireMock.get;
27 import static com.github.tomakehurst.wiremock.client.WireMock.post;
28 import static com.github.tomakehurst.wiremock.client.WireMock.patch;
29 import static com.github.tomakehurst.wiremock.client.WireMock.put;
30 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
31 import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
32 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
36 * Reusable Mock StubResponses for AAI Endpoints
39 public class StubResponseAAI {
41 public static void setupAllMocks() {
47 * Allotted Resource Mock StubResponses below
49 public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
50 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
51 .willReturn(aResponse()
53 .withHeader("Content-Type", "text/xml")
54 .withBodyFile(responseFile)));
57 public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
58 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
59 .willReturn(aResponse()
63 public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
64 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
65 .willReturn(aResponse()
69 public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
70 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))
71 .willReturn(aResponse()
75 public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
76 stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
77 .willReturn(aResponse()
81 public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
82 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
83 .willReturn(aResponse()
85 .withHeader("Content-Type", "text/xml")
86 .withBodyFile(responseFile)));
91 * Service Instance Mock StubResponses below
93 public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId) {
94 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
95 .willReturn(aResponse()
97 .withHeader("Content-Type", "text/xml")));
101 * Service Instance Mock StubResponses below
103 public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
104 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
105 .willReturn(aResponse()
107 .withHeader("Content-Type", "text/xml")
108 .withBodyFile(responseFile)));
111 public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
112 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
113 .willReturn(aResponse()
117 public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
118 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
119 .willReturn(aResponse()
123 public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
124 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
125 .willReturn(aResponse()
127 .withHeader("Content-Type", "text/xml")
128 .withBodyFile(responseFile)));
131 public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
132 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
133 .willReturn(aResponse()
135 .withHeader("Content-Type", "text/xml")
136 .withBodyFile(responseFile)));
139 public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
140 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
141 .willReturn(aResponse()
145 public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
146 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
147 .willReturn(aResponse()
151 public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
152 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
153 .willReturn(aResponse()
155 .withHeader("Content-Type", "text/xml")
156 .withBodyFile(responseFile)));
159 public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
160 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
161 .willReturn(aResponse()
165 public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
166 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
167 .willReturn(aResponse()
171 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
172 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
173 .willReturn(aResponse()
177 public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
178 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
179 .willReturn(aResponse()
180 .withStatus(statusCode)));
183 public static void MockGetServiceInstance(String customer, String serviceSubscription, int statusCode){
184 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription))
185 .willReturn(aResponse()
187 .withHeader("Content-Type", "text/xml")));
190 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
191 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
192 .willReturn(aResponse()
193 .withStatus(statusCode)));
196 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
197 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
198 .willReturn(aResponse()
199 .withStatus(statusCode)));
202 public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
203 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
204 .willReturn(aResponse()
208 public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
209 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
210 .willReturn(aResponse()
214 public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
215 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
216 .willReturn(aResponse()
218 .withHeader("Content-Type", "text/xml")
219 .withBodyFile(responseFile)));
222 public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
223 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
224 .willReturn(aResponse()
229 * Service-Subscription Mock StubResponses below
231 public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
232 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
233 .willReturn(aResponse()
235 .withHeader("Content-Type", "text/xml")
236 .withBodyFile(responseFile)));
239 public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
240 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
241 .willReturn(aResponse()
242 .withStatus(statusCode)));
245 public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
246 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
247 .willReturn(aResponse()
251 public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
252 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
253 .willReturn(aResponse()
257 public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
258 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
259 .willReturn(aResponse()
260 .withStatus(statusCode)));
264 * Customer Mock StubResponses below
266 public static void MockGetCustomer(String globalCustId, String responseFile) {
267 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
268 .willReturn(aResponse()
270 .withHeader("Content-Type", "text/xml")
271 .withBodyFile(responseFile)));
274 public static void MockDeleteCustomer(String globalCustId) {
275 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
276 .willReturn(aResponse()
280 public static void MockPutCustomer(String globalCustId) {
281 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
282 .willReturn(aResponse()
286 public static void MockPutCustomer_500(String globalCustId) {
287 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
288 .willReturn(aResponse()
294 * Generic-Vnf Mock StubResponses below
297 public static void MockGetGenericVnfById(String vnfId, String responseFile){
298 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
299 .willReturn(aResponse()
301 .withHeader("Content-Type", "text/xml")
302 .withBodyFile(responseFile)));
305 public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
306 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
307 .willReturn(aResponse()
308 .withStatus(statusCode)
309 .withHeader("Content-Type", "text/xml")
310 .withBodyFile(responseFile)));
313 public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
314 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
316 .willReturn(aResponse()
317 .withStatus(statusCode)
318 .withHeader("Content-Type", "text/xml")
319 .withBodyFile(responseFile)));
322 public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
323 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
324 .atPriority(priority)
325 .willReturn(aResponse()
326 .withStatus(statusCode)
327 .withHeader("Content-Type", "text/xml")
328 .withBodyFile(responseFile)));
331 public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
332 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
333 .willReturn(aResponse()
335 .withHeader("Content-Type", "text/xml")
336 .withBodyFile(responseFile)));
339 public static void MockGetGenericVnfById_404(String vnfId){
340 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
341 .willReturn(aResponse()
345 public static void MockGetGenericVnfById_500(String vnfId){
346 stubFor(get(urlMatching("/aai/v9/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
347 .withQueryParam("depth", equalTo("1"))
348 .willReturn(aResponse()
352 public static void MockGetGenericVnfByName(String vnfName, String responseFile){
353 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
354 .willReturn(aResponse()
356 .withHeader("Content-Type", "text/xml")
357 .withBodyFile(responseFile)));
360 public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
361 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
362 .willReturn(aResponse()
364 .withHeader("Content-Type", "text/xml")
365 .withBodyFile(responseFile)));
368 public static void MockGetGenericVnfByName_404(String vnfName){
369 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
370 .willReturn(aResponse()
374 public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
375 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
376 .willReturn(aResponse()
380 public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
381 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
382 .willReturn(aResponse()
383 .withStatus(statusCode)));
386 public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
387 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
388 .willReturn(aResponse()
392 public static void MockPutGenericVnf(String vnfId){
393 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
394 .willReturn(aResponse()
398 public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
399 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
400 .withRequestBody(containing(requestBodyContaining))
401 .willReturn(aResponse()
402 .withStatus(statusCode)));
405 public static void MockPutGenericVnf(String vnfId, int statusCode) {
406 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
407 .willReturn(aResponse()
408 .withStatus(statusCode)));
411 public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
412 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
413 .willReturn(aResponse()
414 .withStatus(statusCode)));
417 public static void MockPatchGenericVnf(String vnfId){
418 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
419 .willReturn(aResponse()
423 * Vce Mock StubResponses below
425 public static void MockGetVceById(String vnfId, String responseFile){
426 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
427 .willReturn(aResponse()
429 .withHeader("Content-Type", "text/xml")
430 .withBodyFile(responseFile)));
433 public static void MockGetVceByName(String vnfName, String responseFile){
434 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
435 .willReturn(aResponse()
437 .withHeader("Content-Type", "text/xml")
438 .withBodyFile(responseFile)));
441 public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
442 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
443 .willReturn(aResponse()
444 .withStatus(statusCode)));
447 public static void MockPutVce(String vnfId){
448 stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
449 .willReturn(aResponse()
453 public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
454 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
455 .willReturn(aResponse()
457 .withHeader("Content-Type", "text/xml")
458 .withBodyFile(responseFile)));
461 public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
462 stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=service-instance.service-instance-name:" + serviceInstanceName + "[&]start-node-type=service-instance[&]include=vce[&]depth=" + depth))
463 .willReturn(aResponse()
464 .withStatus(statusCode)
465 .withHeader("Content-Type", "text/xml")
466 .withBodyFile(responseFile)));
470 * Tenant Mock StubResponses below
472 public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
473 stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=customer.global-customer-id:" + customer + "&key=service-subscription.service-type:" + serviceType + "&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1"))
474 .willReturn(aResponse()
476 .withHeader("Content-Type", "text/xml")
477 .withBodyFile(responseFile)));
480 public static void MockGetTenant(String tenantId, String responseFile) {
481 stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
482 .willReturn(aResponse()
484 .withHeader("Content-Type", "text/xml")
485 .withBodyFile(responseFile)));
489 * Network Mock StubResponses below
491 public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
492 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
493 .willReturn(aResponse()
494 .withStatus(statusCode)
495 .withHeader("Content-Type", "text/xml")
496 .withBodyFile(responseFile)));
499 public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
500 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
501 .willReturn(aResponse()
503 .withHeader("Content-Type", "text/xml")
504 .withBodyFile(responseFile)));
507 public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
508 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegion))
509 .willReturn(aResponse()
511 .withHeader("Content-Type", "text/xml")
512 .withBodyFile(responseFile)));
515 public static void MockGetNetworkByName(String networkName, String responseFile) {
516 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
517 .willReturn(aResponse()
519 .withHeader("Content-Type", "text/xml")
520 .withBodyFile(responseFile)));
523 public static void MockGetNetworkByName_404(String responseFile, String networkName) {
524 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
525 .willReturn(aResponse()
527 .withHeader("Content-Type", "text/xml")
528 .withBodyFile(responseFile)));
531 public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
532 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegion))
533 .willReturn(aResponse()
537 public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
538 stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
539 .willReturn(aResponse()
540 .withStatus(statusCode)
541 .withHeader("Content-Type", "text/xml")
542 .withBodyFile(responseFile)));
545 public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
546 stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
547 .willReturn(aResponse()
548 .withStatus(statusCode)
549 .withHeader("Content-Type", "text/xml")
550 .withBodyFile(responseFile)));
553 public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
554 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
555 .willReturn(aResponse()
556 .withStatus(statusCode)
557 .withHeader("Content-Type", "text/xml")
558 .withBodyFile(responseFile)));
561 public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
562 stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
563 .willReturn(aResponse()
565 .withHeader("Content-Type", "text/xml")
566 .withBodyFile(responseFile)));
569 public static void MockGetNetworkPolicy(String responseFile, String policy) {
570 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
571 .willReturn(aResponse()
573 .withHeader("Content-Type", "text/xml")
574 .withBodyFile(responseFile)));
577 public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
578 stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
579 .willReturn(aResponse()
580 .withStatus(statusCode)
581 .withHeader("Content-Type", "text/xml")
582 .withBodyFile(responseFile)));
585 public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
586 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
587 .willReturn(aResponse()
588 .withStatus(statusCode)
589 .withHeader("Content-Type", "text/xml")
590 .withBodyFile(responseFile)));
593 public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
594 stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
595 .willReturn(aResponse()
597 .withHeader("Content-Type", "text/xml")
598 .withBodyFile(responseFile)));
601 public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
602 stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
603 .willReturn(aResponse()
605 .withHeader("Content-Type", "text/xml")
606 .withBodyFile(responseFile)));
609 public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
610 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
611 .willReturn(aResponse()
612 .withStatus(statusCode)
613 .withHeader("Content-Type", "text/xml")
614 .withBodyFile(responseFile)));
617 public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
618 stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
619 .willReturn(aResponse()
620 .withStatus(statusCode)
621 .withHeader("Content-Type", "text/xml")
622 .withBodyFile(responseFile)));
625 public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
626 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
627 .willReturn(aResponse()
633 public static void MockVNFAdapterRestVfModule() {
634 stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
635 .willReturn(aResponse()
637 .withHeader("Content-Type", "application/xml")));
638 stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
639 .willReturn(aResponse()
641 .withHeader("Content-Type", "application/xml")));
642 stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
643 .willReturn(aResponse()
645 .withHeader("Content-Type", "application/xml")));
646 stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
647 .willReturn(aResponse()
649 .withHeader("Content-Type", "application/xml")));
652 public static void MockDBUpdateVfModule(){
653 stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
654 .willReturn(aResponse()
656 .withHeader("Content-Type", "text/xml")
657 .withBodyFile("VfModularity/DBUpdateResponse.xml")));
660 // start of mocks used locally and by other VF Module unit tests
661 public static void MockSDNCAdapterVfModule() {
662 // simplified the implementation to return "success" for all requests
663 stubFor(post(urlEqualTo("/SDNCAdapter"))
664 // .withRequestBody(containing("SvcInstanceId><"))
665 .willReturn(aResponse()
667 .withHeader("Content-Type", "text/xml")
668 .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
672 // start of mocks used locally and by other VF Module unit tests
673 public static void MockAAIVfModule() {
674 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
676 .willReturn(aResponse()
678 .withHeader("Content-Type", "text/xml")
679 .withBodyFile("VfModularity/VfModule-supercool.xml")));
680 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
682 .willReturn(aResponse()
684 .withHeader("Content-Type", "text/xml")
685 .withBodyFile("VfModularity/VfModule-lukewarm.xml")));
686 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
688 .willReturn(aResponse()
690 .withHeader("Content-Type", "text/xml")
691 .withBodyFile("VfModularity/VfModule-new.xml")));
692 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
693 .willReturn(aResponse()
695 .withHeader("Content-Type", "text/xml")
696 .withBodyFile("VfModularity/GenericVnf.xml")));
697 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
698 // .withRequestBody(containing("PCRF"))
699 .willReturn(aResponse()
701 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
702 // .withRequestBody(containing("PCRF"))
703 .willReturn(aResponse()
705 // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
706 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
707 .withRequestBody(containing("PCRF"))
708 .willReturn(aResponse()
710 // HTTP PUT stub still used by DoCreateVfModuleTest
711 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
712 .withRequestBody(containing("MODULELABEL"))
713 .willReturn(aResponse()
715 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
716 .willReturn(aResponse()
718 .withHeader("Content-Type", "text/xml")
719 .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
720 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
721 .willReturn(aResponse()
723 .withHeader("Content-Type", "text/xml")
724 .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
725 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/MDTWNJ21/volume-groups/volume-group/78987"))
726 .willReturn(aResponse()
728 .withHeader("Content-Type", "text/xml")
729 .withBodyFile("VfModularity/VolumeGroup.xml")));
730 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/volume-groups/volume-group/78987"))
731 .willReturn(aResponse()
733 .withHeader("Content-Type", "text/xml")
734 .withBodyFile("VfModularity/VolumeGroup.xml")));
735 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
736 .willReturn(aResponse()
738 .withHeader("Content-Type", "text/xml")
739 .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
740 stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
741 .willReturn(aResponse()
743 .withHeader("Content-Type", "text/xml")
744 .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
745 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
746 .withRequestBody(containing("NEWvBNGModuleId"))
747 .willReturn(aResponse()
756 * Cloud infrastructure below
759 public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
760 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId))
761 .willReturn(aResponse()
762 .withStatus(statusCode)
763 .withHeader("Content-Type", "text/xml")
764 .withBodyFile(responseFile)));
768 * Volume Group StubResponse below
770 public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
771 MockGetVolumeGroupById(cloudRegionId, volumeGroupId, responseFile, 200);
774 public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int responseCode) {
775 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
776 .willReturn(aResponse()
777 .withStatus(responseCode)
778 .withHeader("Content-Type", "text/xml")
779 .withBodyFile(responseFile)));
782 public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
783 stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
784 .willReturn(aResponse()
785 .withStatus(statusCode)
786 .withHeader("Content-Type", "text/xml")
787 .withBodyFile(responseFile)));
790 public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
791 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
792 .willReturn(aResponse()
793 .withStatus(statusCode)
794 .withHeader("Content-Type", "text/xml")
795 .withBodyFile(responseFile)));
798 public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
799 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
800 .willReturn(aResponse()
801 .withStatus(statusCode)));
804 public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
805 stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
806 .willReturn(aResponse()
810 public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
811 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
812 .willReturn(aResponse()
817 * VF-Module StubResponse below
818 * @param statusCode TODO
820 public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
821 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
822 .willReturn(aResponse()
823 .withStatus(statusCode)
824 .withHeader("Content-Type", "text/xml")
825 .withBodyFile(responseFile)));
828 public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
829 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
830 .willReturn(aResponse()
831 .withStatus(statusCode)
832 .withHeader("Content-Type", "text/xml")
833 .withBodyFile(responseFile)));
836 public static void MockGetVfModuleByName(String vnfId, String vfModuleName, String responseFile, int statusCode) {
837 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName))
838 .willReturn(aResponse()
839 .withStatus(statusCode)
840 .withHeader("Content-Type", "text/xml")
841 .withBodyFile(responseFile)));
844 public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
845 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
846 .withRequestBody(containing(requestContaining))
847 .willReturn(aResponse()
849 .withHeader("Content-Type", "text/xml")));
852 public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
853 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
854 .withRequestBody(containing(requestContaining))
855 .willReturn(aResponse()
859 public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
860 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
861 .willReturn(aResponse()
865 public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
866 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
867 .willReturn(aResponse()
868 .withStatus(returnCode)));
871 public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
872 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
873 .willReturn(aResponse()
874 .withStatus(returnCode)));
877 public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
878 stubFor(patch(urlMatching(endpoint))
879 .willReturn(aResponse()
880 .withStatus(statusCode)));
883 /* AAI Pserver Queries */
884 public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
885 stubFor(put(urlMatching("/aai/v1[0-9]/query.*"))
886 .willReturn(aResponse()
887 .withStatus(statusCode)
888 .withHeader("Content-Type", "application/json")
889 .withBodyFile(responseFile)));
892 public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
893 stubFor(get(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
894 .willReturn(aResponse()
895 .withStatus(statusCode)
896 .withHeader("Content-Type", "application/json; charset=utf-8")
897 .withBodyFile(responseFile)));
900 public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
901 stubFor(patch(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
902 .willReturn(aResponse()
903 .withStatus(statusCode)
907 public static void MockSetInMaintFlagByVnfId(String vnfId, String responseFile, int statusCode) {
908 stubFor(post(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
909 .willReturn(aResponse()
910 .withStatus(statusCode)
911 .withBodyFile(responseFile)
915 public static void MockGetDefaultCloudRegionByCloudRegionId(String cloudRegionId, String responseFile, int statusCode) {
916 stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegionId + ".*"))
917 .willReturn(aResponse()
918 .withStatus(statusCode)
919 .withHeader("Content-Type", "application/json; charset=utf-8")
920 .withBodyFile(responseFile)));
923 //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
925 public static void MockGetVceById(){
926 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
927 .willReturn(aResponse()
929 .withHeader("Content-Type", "text/xml")
930 .withBodyFile("GenericFlows/getVceResponse.xml")));
933 public static void MockGetVceByName(){
934 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
935 .willReturn(aResponse()
937 .withHeader("Content-Type", "text/xml")
938 .withBodyFile("GenericFlows/getVceByNameResponse.xml")));
941 public static void MockPutVce(){
942 stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
943 .willReturn(aResponse()
947 public static void MockDeleteVce(){
948 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
949 .willReturn(aResponse()
953 public static void MockDeleteVce_404(){
954 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
955 .willReturn(aResponse()
960 public static void MockDeleteServiceSubscription(){
961 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
962 .willReturn(aResponse()
966 public static void MockGetServiceSubscription(){
967 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
968 .willReturn(aResponse()
970 .withHeader("Content-Type", "text/xml")
971 .withBodyFile("GenericFlows/getServiceSubscription.xml")));
974 public static void MockGetServiceSubscription_200Empty(){
975 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
976 .willReturn(aResponse()
978 .withHeader("Content-Type", "text/xml")
982 public static void MockGetServiceSubscription_404() {
983 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
984 .willReturn(aResponse()
989 public static void MockGetGenericVnfById(){
990 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
991 .willReturn(aResponse()
993 .withHeader("Content-Type", "text/xml")
994 .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
997 public static void MockGetGenericVnfById_404(){
998 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
999 .willReturn(aResponse()
1003 public static void MockGetGenericVnfByName(){
1004 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
1005 .willReturn(aResponse()
1007 .withHeader("Content-Type", "text/xml")
1008 .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
1011 public static void MockGetGenericVnfByName_hasRelationships(){
1012 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
1013 .willReturn(aResponse()
1015 .withHeader("Content-Type", "text/xml")
1016 .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
1019 public static void MockGetGenericVnfById_hasRelationships(){
1020 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1021 .willReturn(aResponse()
1023 .withHeader("Content-Type", "text/xml")
1024 .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
1027 public static void MockGetGenericVnfById_500(){
1028 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1029 .willReturn(aResponse()
1033 public static void MockGetGenericVnfByName_404(){
1034 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
1035 .willReturn(aResponse()
1039 public static void MockPutGenericVnf(){
1040 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1041 .willReturn(aResponse()
1045 public static void MockPutGenericVnf_400(){
1046 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1047 .willReturn(aResponse()
1051 public static void MockDeleteGenericVnf(){
1052 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
1053 .willReturn(aResponse()
1057 public static void MockDeleteGenericVnf_404(){
1058 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
1059 .willReturn(aResponse()
1063 public static void MockDeleteGenericVnf_500(){
1064 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
1065 .willReturn(aResponse()
1069 public static void MockDeleteGenericVnf_412(){
1070 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
1071 .willReturn(aResponse()