2 * ============LICENSE_START=======================================================
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
19 package org.openecomp.mso.bpmn.mock;
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;
34 * Reusable Mock StubResponses for AAI Endpoints
37 public class StubResponseAAI {
39 public static void setupAllMocks() {
45 * Tunnel-XConnect Mock Stub Response
47 public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
48 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 + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))
49 .willReturn(aResponse()
55 * Allotted Resource Mock StubResponses below
57 public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
58 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))
59 .willReturn(aResponse()
61 .withHeader("Content-Type", "text/xml")
62 .withBodyFile(responseFile)));
65 public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
66 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))
67 .willReturn(aResponse()
71 public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
72 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))
73 .willReturn(aResponse()
77 public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
78 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))
79 .willReturn(aResponse()
83 public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
84 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))
85 .willReturn(aResponse()
89 public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
90 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
91 .willReturn(aResponse()
93 .withHeader("Content-Type", "text/xml")
94 .withBodyFile(responseFile)));
99 * Service Instance Mock StubResponses below
101 public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
102 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
103 .willReturn(aResponse()
105 .withHeader("Content-Type", "text/xml")
106 .withBodyFile(responseFile)));
109 public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
110 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
111 .willReturn(aResponse()
115 public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
116 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
117 .willReturn(aResponse()
121 public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
122 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
123 .willReturn(aResponse()
125 .withHeader("Content-Type", "text/xml")
126 .withBodyFile(responseFile)));
129 public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
130 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
131 .willReturn(aResponse()
133 .withHeader("Content-Type", "text/xml")
134 .withBodyFile(responseFile)));
137 public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
138 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
139 .willReturn(aResponse()
143 public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
144 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
145 .willReturn(aResponse()
149 public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
150 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
151 .willReturn(aResponse()
153 .withHeader("Content-Type", "text/xml")
154 .withBodyFile(responseFile)));
157 public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
158 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
159 .willReturn(aResponse()
163 public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
164 stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
165 .willReturn(aResponse()
169 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
170 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
171 .willReturn(aResponse()
175 public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
176 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
177 .willReturn(aResponse()
178 .withStatus(statusCode)));
181 public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
182 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))
183 .willReturn(aResponse()
185 .withHeader("Content-Type", "text/xml")));
188 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
189 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
190 .willReturn(aResponse()
191 .withStatus(statusCode)));
194 public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
195 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
196 .willReturn(aResponse()
197 .withStatus(statusCode)));
200 public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
201 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
202 .willReturn(aResponse()
206 public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
207 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
208 .willReturn(aResponse()
212 public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
213 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
214 .willReturn(aResponse()
216 .withHeader("Content-Type", "text/xml")
217 .withBodyFile(responseFile)));
220 public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
221 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
222 .willReturn(aResponse()
227 * Service-Subscription Mock StubResponses below
229 public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
230 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
231 .willReturn(aResponse()
233 .withHeader("Content-Type", "text/xml")
234 .withBodyFile(responseFile)));
237 public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
238 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
239 .willReturn(aResponse()
240 .withStatus(statusCode)));
243 public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
244 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
245 .willReturn(aResponse()
249 public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
250 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
251 .willReturn(aResponse()
255 public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
256 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
257 .willReturn(aResponse()
258 .withStatus(statusCode)));
262 * Customer Mock StubResponses below
264 public static void MockGetCustomer(String globalCustId, String responseFile) {
265 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
266 .willReturn(aResponse()
268 .withHeader("Content-Type", "text/xml")
269 .withBodyFile(responseFile)));
272 public static void MockDeleteCustomer(String globalCustId) {
273 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
274 .willReturn(aResponse()
278 public static void MockPutCustomer(String globalCustId) {
279 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
280 .willReturn(aResponse()
284 public static void MockPutCustomer_500(String globalCustId) {
285 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
286 .willReturn(aResponse()
292 * Generic-Vnf Mock StubResponses below
295 public static void MockGetGenericVnfById(String vnfId, String responseFile){
296 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
297 .willReturn(aResponse()
299 .withHeader("Content-Type", "text/xml")
300 .withBodyFile(responseFile)));
303 public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
304 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
305 .willReturn(aResponse()
306 .withStatus(statusCode)
307 .withHeader("Content-Type", "text/xml")
308 .withBodyFile(responseFile)));
311 public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
312 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
314 .willReturn(aResponse()
315 .withStatus(statusCode)
316 .withHeader("Content-Type", "text/xml")
317 .withBodyFile(responseFile)));
320 public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
321 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
322 .atPriority(priority)
323 .willReturn(aResponse()
324 .withStatus(statusCode)
325 .withHeader("Content-Type", "text/xml")
326 .withBodyFile(responseFile)));
329 public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
330 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
331 .willReturn(aResponse()
333 .withHeader("Content-Type", "text/xml")
334 .withBodyFile(responseFile)));
337 public static void MockGetGenericVnfById_404(String vnfId){
338 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
339 .willReturn(aResponse()
343 public static void MockGetGenericVnfById_500(String vnfId){
344 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
345 .willReturn(aResponse()
349 public static void MockGetGenericVnfByName(String vnfName, String responseFile){
350 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
351 .willReturn(aResponse()
353 .withHeader("Content-Type", "text/xml")
354 .withBodyFile(responseFile)));
357 public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
358 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
359 .willReturn(aResponse()
361 .withHeader("Content-Type", "text/xml")
362 .withBodyFile(responseFile)));
365 public static void MockGetGenericVnfByName_404(String vnfName){
366 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
367 .willReturn(aResponse()
371 public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
372 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
373 .willReturn(aResponse()
377 public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
378 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
379 .willReturn(aResponse()
380 .withStatus(statusCode)));
383 public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
384 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
385 .willReturn(aResponse()
389 public static void MockPutGenericVnf(String vnfId){
390 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
391 .willReturn(aResponse()
395 public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
396 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
397 .withRequestBody(containing(requestBodyContaining))
398 .willReturn(aResponse()
399 .withStatus(statusCode)));
402 public static void MockPutGenericVnf(String vnfId, int statusCode) {
403 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
404 .willReturn(aResponse()
405 .withStatus(statusCode)));
408 public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
409 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
410 .willReturn(aResponse()
411 .withStatus(statusCode)));
414 public static void MockPatchGenericVnf(String vnfId){
415 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
416 .willReturn(aResponse()
420 * Vce Mock StubResponses below
422 public static void MockGetVceById(String vnfId, String responseFile){
423 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
424 .willReturn(aResponse()
426 .withHeader("Content-Type", "text/xml")
427 .withBodyFile(responseFile)));
430 public static void MockGetVceByName(String vnfName, String responseFile){
431 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
432 .willReturn(aResponse()
434 .withHeader("Content-Type", "text/xml")
435 .withBodyFile(responseFile)));
438 public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
439 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
440 .willReturn(aResponse()
441 .withStatus(statusCode)));
444 public static void MockPutVce(String vnfId){
445 stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
446 .willReturn(aResponse()
450 public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
451 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
452 .willReturn(aResponse()
454 .withHeader("Content-Type", "text/xml")
455 .withBodyFile(responseFile)));
458 public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
459 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))
460 .willReturn(aResponse()
461 .withStatus(statusCode)
462 .withHeader("Content-Type", "text/xml")
463 .withBodyFile(responseFile)));
467 * Tenant Mock StubResponses below
469 public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
470 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"))
471 .willReturn(aResponse()
473 .withHeader("Content-Type", "text/xml")
474 .withBodyFile(responseFile)));
477 public static void MockGetTenant(String tenantId, String responseFile) {
478 stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
479 .willReturn(aResponse()
481 .withHeader("Content-Type", "text/xml")
482 .withBodyFile(responseFile)));
486 * Network Mock StubResponses below
488 public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
489 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
490 .willReturn(aResponse()
491 .withStatus(statusCode)
492 .withHeader("Content-Type", "text/xml")
493 .withBodyFile(responseFile)));
496 public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
497 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
498 .willReturn(aResponse()
500 .withHeader("Content-Type", "text/xml")
501 .withBodyFile(responseFile)));
504 public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
505 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
506 .willReturn(aResponse()
508 .withHeader("Content-Type", "text/xml")
509 .withBodyFile(responseFile)));
512 public static void MockGetNetworkByName(String networkName, String responseFile) {
513 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
514 .willReturn(aResponse()
516 .withHeader("Content-Type", "text/xml")
517 .withBodyFile(responseFile)));
520 public static void MockGetNetworkByName_404(String responseFile, String networkName) {
521 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
522 .willReturn(aResponse()
524 .withHeader("Content-Type", "text/xml")
525 .withBodyFile(responseFile)));
528 public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
529 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
530 .willReturn(aResponse()
534 public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
535 stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
536 .willReturn(aResponse()
537 .withStatus(statusCode)
538 .withHeader("Content-Type", "text/xml")
539 .withBodyFile(responseFile)));
542 public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
543 stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
544 .willReturn(aResponse()
545 .withStatus(statusCode)
546 .withHeader("Content-Type", "text/xml")
547 .withBodyFile(responseFile)));
550 public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
551 stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
552 .willReturn(aResponse()
553 .withStatus(statusCode)
554 .withHeader("Content-Type", "text/xml")
555 .withBodyFile(responseFile)));
558 public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
559 stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
560 .willReturn(aResponse()
562 .withHeader("Content-Type", "text/xml")
563 .withBodyFile(responseFile)));
566 public static void MockGetNetworkPolicy(String responseFile, String policy) {
567 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
568 .willReturn(aResponse()
570 .withHeader("Content-Type", "text/xml")
571 .withBodyFile(responseFile)));
574 public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
575 stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
576 .willReturn(aResponse()
577 .withStatus(statusCode)
578 .withHeader("Content-Type", "text/xml")
579 .withBodyFile(responseFile)));
582 public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
583 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
584 .willReturn(aResponse()
585 .withStatus(statusCode)
586 .withHeader("Content-Type", "text/xml")
587 .withBodyFile(responseFile)));
590 public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
591 stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
592 .willReturn(aResponse()
594 .withHeader("Content-Type", "text/xml")
595 .withBodyFile(responseFile)));
598 public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
599 stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
600 .willReturn(aResponse()
602 .withHeader("Content-Type", "text/xml")
603 .withBodyFile(responseFile)));
606 public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
607 stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
608 .willReturn(aResponse()
609 .withStatus(statusCode)
610 .withHeader("Content-Type", "text/xml")
611 .withBodyFile(responseFile)));
614 public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
615 stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
616 .willReturn(aResponse()
617 .withStatus(statusCode)
618 .withHeader("Content-Type", "text/xml")
619 .withBodyFile(responseFile)));
622 public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
623 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
624 .willReturn(aResponse()
630 public static void MockVNFAdapterRestVfModule() {
631 stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
632 .willReturn(aResponse()
634 .withHeader("Content-Type", "application/xml")));
635 stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
636 .willReturn(aResponse()
638 .withHeader("Content-Type", "application/xml")));
639 stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
640 .willReturn(aResponse()
642 .withHeader("Content-Type", "application/xml")));
643 stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
644 .willReturn(aResponse()
646 .withHeader("Content-Type", "application/xml")));
649 public static void MockDBUpdateVfModule(){
650 stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
651 .willReturn(aResponse()
653 .withHeader("Content-Type", "text/xml")
654 .withBodyFile("VfModularity/DBUpdateResponse.xml")));
657 // start of mocks used locally and by other VF Module unit tests
658 public static void MockSDNCAdapterVfModule() {
659 // simplified the implementation to return "success" for all requests
660 stubFor(post(urlEqualTo("/SDNCAdapter"))
661 // .withRequestBody(containing("SvcInstanceId><"))
662 .willReturn(aResponse()
664 .withHeader("Content-Type", "text/xml")
665 .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
669 // start of mocks used locally and by other VF Module unit tests
670 public static void MockAAIVfModule() {
671 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
673 .willReturn(aResponse()
675 .withHeader("Content-Type", "text/xml")
676 .withBodyFile("VfModularity/VfModule-supercool.xml")));
677 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
679 .willReturn(aResponse()
681 .withHeader("Content-Type", "text/xml")
682 .withBodyFile("VfModularity/VfModule-lukewarm.xml")));
683 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
685 .willReturn(aResponse()
687 .withHeader("Content-Type", "text/xml")
688 .withBodyFile("VfModularity/VfModule-new.xml")));
689 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
690 .willReturn(aResponse()
692 .withHeader("Content-Type", "text/xml")
693 .withBodyFile("VfModularity/GenericVnf.xml")));
694 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
695 // .withRequestBody(containing("PCRF"))
696 .willReturn(aResponse()
698 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
699 // .withRequestBody(containing("PCRF"))
700 .willReturn(aResponse()
702 // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
703 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
704 .withRequestBody(containing("PCRF"))
705 .willReturn(aResponse()
707 // HTTP PUT stub still used by DoCreateVfModuleTest
708 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
709 .withRequestBody(containing("MODULELABEL"))
710 .willReturn(aResponse()
712 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
713 .willReturn(aResponse()
715 .withHeader("Content-Type", "text/xml")
716 .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
717 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
718 .willReturn(aResponse()
720 .withHeader("Content-Type", "text/xml")
721 .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
722 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))
723 .willReturn(aResponse()
725 .withHeader("Content-Type", "text/xml")
726 .withBodyFile("VfModularity/VolumeGroup.xml")));
727 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))
728 .willReturn(aResponse()
730 .withHeader("Content-Type", "text/xml")
731 .withBodyFile("VfModularity/VolumeGroup.xml")));
732 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
733 .willReturn(aResponse()
735 .withHeader("Content-Type", "text/xml")
736 .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
737 stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
738 .willReturn(aResponse()
740 .withHeader("Content-Type", "text/xml")
741 .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
742 stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
743 .withRequestBody(containing("NEWvBNGModuleId"))
744 .willReturn(aResponse()
753 * Cloud infrastructure below
756 public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
757 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
758 .willReturn(aResponse()
759 .withStatus(statusCode)
760 .withHeader("Content-Type", "text/xml")
761 .withBodyFile(responseFile)));
765 * Volume Group StubResponse below
767 public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
768 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
769 .willReturn(aResponse()
771 .withHeader("Content-Type", "text/xml")
772 .withBodyFile(responseFile)));
775 public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
776 stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
777 .willReturn(aResponse()
778 .withStatus(statusCode)
779 .withHeader("Content-Type", "text/xml")
780 .withBodyFile(responseFile)));
783 public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
784 stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
785 .willReturn(aResponse()
786 .withStatus(statusCode)
787 .withHeader("Content-Type", "text/xml")
788 .withBodyFile(responseFile)));
791 public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
792 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
793 .willReturn(aResponse()
794 .withStatus(statusCode)));
797 public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
798 stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
799 .willReturn(aResponse()
803 public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
804 stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
805 .willReturn(aResponse()
810 * VF-Module StubResponse below
811 * @param statusCode TODO
813 public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
814 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
815 .willReturn(aResponse()
816 .withStatus(statusCode)
817 .withHeader("Content-Type", "text/xml")
818 .withBodyFile(responseFile)));
821 public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
822 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
823 .willReturn(aResponse()
824 .withStatus(statusCode)
825 .withHeader("Content-Type", "text/xml")
826 .withBodyFile(responseFile)));
829 public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
830 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
831 .withRequestBody(containing(requestContaining))
832 .willReturn(aResponse()
834 .withHeader("Content-Type", "text/xml")));
837 public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
838 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
839 .withRequestBody(containing(requestContaining))
840 .willReturn(aResponse()
844 public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
845 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
846 .willReturn(aResponse()
850 public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
851 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
852 .willReturn(aResponse()
853 .withStatus(returnCode)));
856 public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
857 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
858 .willReturn(aResponse()
859 .withStatus(returnCode)));
862 public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
863 stubFor(patch(urlMatching(endpoint))
864 .willReturn(aResponse()
865 .withStatus(statusCode)));
868 /* AAI Pserver Queries */
869 public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
870 stubFor(put(urlMatching("/v10/query.*"))
871 .willReturn(aResponse()
872 .withStatus(statusCode)
873 .withHeader("Content-Type", "application/json")
874 .withBodyFile(responseFile)));
877 public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
878 stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))
879 .willReturn(aResponse()
880 .withStatus(statusCode)
881 .withHeader("Content-Type", "application/json; charset=utf-8")
882 .withBodyFile(responseFile)));
885 public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
886 stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))
887 .willReturn(aResponse()
888 .withStatus(statusCode)
892 //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
894 public static void MockGetVceById(){
895 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
896 .willReturn(aResponse()
898 .withHeader("Content-Type", "text/xml")
899 .withBodyFile("GenericFlows/getVceResponse.xml")));
902 public static void MockGetVceByName(){
903 stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
904 .willReturn(aResponse()
906 .withHeader("Content-Type", "text/xml")
907 .withBodyFile("GenericFlows/getVceByNameResponse.xml")));
910 public static void MockPutVce(){
911 stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
912 .willReturn(aResponse()
916 public static void MockDeleteVce(){
917 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
918 .willReturn(aResponse()
922 public static void MockDeleteVce_404(){
923 stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
924 .willReturn(aResponse()
929 public static void MockDeleteServiceSubscription(){
930 stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
931 .willReturn(aResponse()
935 public static void MockGetServiceSubscription(){
936 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
937 .willReturn(aResponse()
939 .withHeader("Content-Type", "text/xml")
940 .withBodyFile("GenericFlows/getServiceSubscription.xml")));
943 public static void MockGetServiceSubscription_200Empty(){
944 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
945 .willReturn(aResponse()
947 .withHeader("Content-Type", "text/xml")
951 public static void MockGetServiceSubscription_404() {
952 stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
953 .willReturn(aResponse()
957 public static void MockGENPSIPutServiceInstance(){
958 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
959 .willReturn(aResponse()
961 .withHeader("Content-Type", "text/xml")
962 .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
966 public static void MockGENPSIPutServiceSubscription(){
967 stubFor(put(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("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
974 public static void MockGENPSIPutServiceInstance_get500(){
975 stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
976 .willReturn(aResponse()
978 .withHeader("Content-Type", "text/xml")
979 .withBodyFile("GenericPutServiceInstance/aaiFault.xml")));
983 public static void MockGetGenericVnfById(){
984 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
985 .willReturn(aResponse()
987 .withHeader("Content-Type", "text/xml")
988 .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
991 public static void MockGetGenericVnfById_404(){
992 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
993 .willReturn(aResponse()
997 public static void MockGetGenericVnfByName(){
998 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
999 .willReturn(aResponse()
1001 .withHeader("Content-Type", "text/xml")
1002 .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
1005 public static void MockGetGenericVnfByName_hasRelationships(){
1006 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
1007 .willReturn(aResponse()
1009 .withHeader("Content-Type", "text/xml")
1010 .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
1013 public static void MockGetGenericVnfById_hasRelationships(){
1014 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1015 .willReturn(aResponse()
1017 .withHeader("Content-Type", "text/xml")
1018 .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
1021 public static void MockGetGenericVnfById_500(){
1022 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1023 .willReturn(aResponse()
1027 public static void MockGetGenericVnfByName_404(){
1028 stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
1029 .willReturn(aResponse()
1033 public static void MockPutGenericVnf(){
1034 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1035 .willReturn(aResponse()
1039 public static void MockPutGenericVnf_400(){
1040 stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
1041 .willReturn(aResponse()
1045 public static void MockDeleteGenericVnf(){
1046 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
1047 .willReturn(aResponse()
1051 public static void MockDeleteGenericVnf_404(){
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_500(){
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_412(){
1064 stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
1065 .willReturn(aResponse()