aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java
blob: 32f2641ddb2d6fca205f7002dae1ee464bdd0021 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
/*
 * ============LICENSE_START======================================================= 
 * ONAP - SO 
 * ================================================================================ 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * ============LICENSE_END========================================================= 
 */ 

package org.openecomp.mso.bpmn.mock;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.containing;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.patch;
import static com.github.tomakehurst.wiremock.client.WireMock.put;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;


/**
 * Reusable Mock StubResponses for AAI Endpoints
 *
 */
public class StubResponseAAI {

	public static void setupAllMocks() {

	}


	/**
	 * Tunnel-XConnect Mock Stub Response
	 */
	public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
		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))
				.willReturn(aResponse()
						.withStatus(200)));
	}


	/**
	 * Allotted Resource Mock StubResponses below
	 */
	public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
		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))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
		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))
				.willReturn(aResponse()
						.withStatus(200)));
	}

	public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
		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))
				.willReturn(aResponse()
						.withStatus(500)));
	}
	
	public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
		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))
				.willReturn(aResponse()
						.withStatus(204)));
	}
	
	public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
		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))
				.willReturn(aResponse()
						.withStatus(200)));
	}

	public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}


	/**
	 * Service Instance Mock StubResponses below
	 */
	public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
						.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
						.willReturn(aResponse()
						.withStatus(500)));
	}

	public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
						.willReturn(aResponse()
						.withStatus(500)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
				.willReturn(aResponse()
						.withStatus(500)));
	}

	public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
		stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(500)));
	}

	public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
				  .willReturn(aResponse()
				  .withStatus(204)));
	}
	
	public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
				  .willReturn(aResponse()
				  .withStatus(statusCode)));
	}
	
	public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))
				  .willReturn(aResponse()
				  .withStatus(200)
				  .withHeader("Content-Type", "text/xml")));
	}
	
	public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(statusCode)));
	}
	
	public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
				  .willReturn(aResponse()
				  .withStatus(statusCode)));
	}

	public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
				 .willReturn(aResponse()
				  .withStatus(404)));
	}

	public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
				 .willReturn(aResponse()
				  .withStatus(500)));
	}

	public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(500)));
	}

	/**
	 * Service-Subscription Mock StubResponses below
	 */
	public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
				.willReturn(aResponse()
						.withStatus(statusCode)));
	}

	public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
				.willReturn(aResponse()
						.withStatus(200)));
	}

	public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	
	public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
				.willReturn(aResponse()
				.withStatus(statusCode)));
	}

	/**
	 * Customer Mock StubResponses below
	 */
	public static void MockGetCustomer(String globalCustId, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockDeleteCustomer(String globalCustId) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
				.willReturn(aResponse()
						.withStatus(200)));
	}

	public static void MockPutCustomer(String globalCustId) {
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
				.willReturn(aResponse()
						.withStatus(200)));
	}

	public static void MockPutCustomer_500(String globalCustId) {
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
				.willReturn(aResponse()
						.withStatus(500)));
	}


	/**
	 * Generic-Vnf Mock StubResponses below
	 */
	
	public static void MockGetGenericVnfById(String vnfId, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
				.atPriority(1)
				.willReturn(aResponse()
					.withStatus(statusCode)
					.withHeader("Content-Type", "text/xml")
					.withBodyFile(responseFile)));	
	}
	
	public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.atPriority(priority)
				.willReturn(aResponse()
					.withStatus(statusCode)
					.withHeader("Content-Type", "text/xml")
					.withBodyFile(responseFile)));	
	}

	public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetGenericVnfById_404(String vnfId){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockGetGenericVnfById_500(String vnfId){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
				.willReturn(aResponse()
						.withStatus(500)));
	}

	public static void MockGetGenericVnfByName(String vnfName, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockGetGenericVnfByName_404(String vnfName){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(204)));
	}

	public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(statusCode)));
	}

	public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(500)));
	}

	public static void MockPutGenericVnf(String vnfId){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	
	public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
				.withRequestBody(containing(requestBodyContaining))
				.willReturn(aResponse()
					.withStatus(statusCode)));
	}

	public static void MockPutGenericVnf(String vnfId, int statusCode) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
				.willReturn(aResponse()
					.withStatus(statusCode)));
	}
	
	public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
				.willReturn(aResponse()
						.withStatus(statusCode)));
	}

	public static void MockPatchGenericVnf(String vnfId){
		stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	/**
	 * Vce Mock StubResponses below
	 */
	public static void MockGetVceById(String vnfId, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockGetVceByName(String vnfName, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(statusCode)));
	}

	public static void MockPutVce(String vnfId){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	
	public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
		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))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	/**
	 * Tenant Mock StubResponses below
	 */
	public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
		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"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	public static void MockGetTenant(String tenantId, String responseFile) {
		stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}

	/**
	 * Network Mock StubResponses below
	 */
	public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkByName(String networkName, String responseFile) {
		   stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
					.willReturn(aResponse()
							.withStatus(200)
							.withHeader("Content-Type", "text/xml")
							.withBodyFile(responseFile)));
	}

	public static void MockGetNetworkByName_404(String responseFile, String networkName) {
 	stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
				.willReturn(aResponse()
						.withStatus(404)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}

	public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}	
	
	public static void MockGetNetworkPolicy(String responseFile, String policy) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}
	
	public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
				  .willReturn(aResponse()
				  .withStatus(statusCode)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile(responseFile)));
	}
	
	public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
		stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	
	/////////////
	
	public static void MockVNFAdapterRestVfModule() {
		stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
			.willReturn(aResponse()
				.withStatus(202)
				.withHeader("Content-Type", "application/xml")));
		stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
				.willReturn(aResponse()
					.withStatus(202)
					.withHeader("Content-Type", "application/xml")));
		stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
			.willReturn(aResponse()
				.withStatus(202)
				.withHeader("Content-Type", "application/xml")));
		stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
			.willReturn(aResponse()
				.withStatus(202)
				.withHeader("Content-Type", "application/xml")));
	}
	
	public static void MockDBUpdateVfModule(){
		stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
			.willReturn(aResponse()
				.withStatus(200)
			    .withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/DBUpdateResponse.xml")));
	}
	
	// start of mocks used locally and by other VF Module unit tests
	public static void MockSDNCAdapterVfModule() {
		// simplified the implementation to return "success" for all requests
		stubFor(post(urlEqualTo("/SDNCAdapter"))
//			.withRequestBody(containing("SvcInstanceId><"))
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));

	}
	
	// start of mocks used locally and by other VF Module unit tests
	public static void MockAAIVfModule() {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
			.atPriority(1)
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/VfModule-supercool.xml")));		
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
			.atPriority(2)
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/VfModule-lukewarm.xml")));
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
			.atPriority(5)
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/VfModule-new.xml")));
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/GenericVnf.xml")));
		stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
//			.withRequestBody(containing("PCRF"))
			.willReturn(aResponse()
				.withStatus(200)));
		stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
//				.withRequestBody(containing("PCRF"))
				.willReturn(aResponse()
					.withStatus(200)));
		// HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
				.withRequestBody(containing("PCRF"))
				.willReturn(aResponse()
					.withStatus(200)));
		// HTTP PUT stub still used by DoCreateVfModuleTest
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
				.withRequestBody(containing("MODULELABEL"))
				.willReturn(aResponse()
					.withStatus(200)));
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
				.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))
			.willReturn(aResponse()
				.withStatus(200)
				.withHeader("Content-Type", "text/xml")
				.withBodyFile("VfModularity/VolumeGroup.xml")));
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))
				.willReturn(aResponse()
					.withStatus(200)
					.withHeader("Content-Type", "text/xml")
					.withBodyFile("VfModularity/VolumeGroup.xml")));
		stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
			     .willReturn(aResponse()
			     .withStatus(200)
			     .withHeader("Content-Type", "text/xml")
			     .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
		stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
				  .willReturn(aResponse()
				  .withStatus(200)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
		stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
				.withRequestBody(containing("NEWvBNGModuleId"))
				.willReturn(aResponse()
					.withStatus(200)));
	}

	
	
	//////////////

	/**
	 * Cloud infrastructure below
	 */
	
	public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	/**
	 * Volume Group StubResponse below
	 */
	public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
		stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
				  .willReturn(aResponse()
				  .withStatus(statusCode)));
	}

	public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
		stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
				.willReturn(aResponse()
				.withStatus(404)));
	}
	
	public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
				.withStatus(200)));
	}
	
	/**
	 * VF-Module StubResponse below
	 * @param statusCode TODO
	 */
	public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.withRequestBody(containing(requestContaining))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")));
	}

	public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
				.withRequestBody(containing(requestContaining))
				.willReturn(aResponse()
					.withStatus(200)));
	}
	
	public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	
	public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
				.willReturn(aResponse()
						.withStatus(returnCode)));
	}
	
	public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
				.willReturn(aResponse()
						.withStatus(returnCode)));
	}

	public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
		stubFor(patch(urlMatching(endpoint))
			.willReturn(aResponse()
				.withStatus(statusCode)));
	}
	
	/* AAI Pserver Queries */
	public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
		stubFor(put(urlMatching("/v10/query.*"))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "application/json")
						.withBodyFile(responseFile)));
	}
	
	public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
		stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))
				.willReturn(aResponse()
						.withStatus(statusCode)
						.withHeader("Content-Type", "application/json; charset=utf-8")
						.withBodyFile(responseFile)));
	}
	
	public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
		stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))
				.willReturn(aResponse()
						.withStatus(statusCode)
						));
	}
	
	//// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
	@Deprecated
	public static void MockGetVceById(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getVceResponse.xml")));
	}
	@Deprecated
	public static void MockGetVceByName(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getVceByNameResponse.xml")));
	}
	@Deprecated
	public static void MockPutVce(){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	@Deprecated
	public static void MockDeleteVce(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(204)));
	}
	@Deprecated
	public static void MockDeleteVce_404(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(404)));
	}

	@Deprecated
	public static void MockDeleteServiceSubscription(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
				  .willReturn(aResponse()
				  .withStatus(204)));
	}
	@Deprecated
	public static void MockGetServiceSubscription(){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
				  .willReturn(aResponse()
				  .withStatus(200)
				  .withHeader("Content-Type", "text/xml")
				  .withBodyFile("GenericFlows/getServiceSubscription.xml")));
	}
	@Deprecated
	public static void MockGetServiceSubscription_200Empty(){
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
				  .willReturn(aResponse()
				  .withStatus(200)
				  .withHeader("Content-Type", "text/xml")
				  .withBody(" ")));
	}
	@Deprecated
	public static void MockGetServiceSubscription_404() {
		stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
				.willReturn(aResponse()
						.withStatus(404)));
	}
	@Deprecated
	public static void MockGENPSIPutServiceInstance(){
		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"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
	}

	@Deprecated
	public static void MockGENPSIPutServiceSubscription(){
		stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
	}
	@Deprecated
	public static void MockGENPSIPutServiceInstance_get500(){
		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"))
				.willReturn(aResponse()
						.withStatus(500)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericPutServiceInstance/aaiFault.xml")));
	}

	@Deprecated
	public static void MockGetGenericVnfById(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
	}
	@Deprecated
	public static void MockGetGenericVnfById_404(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(404)));
	}
	@Deprecated
	public static void MockGetGenericVnfByName(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
	}
	@Deprecated
	public static void MockGetGenericVnfByName_hasRelationships(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
	}
	@Deprecated
	public static void MockGetGenericVnfById_hasRelationships(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(200)
						.withHeader("Content-Type", "text/xml")
						.withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
	}
	@Deprecated
	public static void MockGetGenericVnfById_500(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(500)));
	}
	@Deprecated
	public static void MockGetGenericVnfByName_404(){
		stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
				.willReturn(aResponse()
						.withStatus(404)));
	}
	@Deprecated
	public static void MockPutGenericVnf(){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(200)));
	}
	@Deprecated
	public static void MockPutGenericVnf_400(){
		stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
				.willReturn(aResponse()
						.withStatus(400)));
	}
	@Deprecated
	public static void MockDeleteGenericVnf(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(204)));
	}
	@Deprecated
	public static void MockDeleteGenericVnf_404(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(404)));
	}
	@Deprecated
	public static void MockDeleteGenericVnf_500(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(500)));
	}
	@Deprecated
	public static void MockDeleteGenericVnf_412(){
		stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
				.willReturn(aResponse()
						.withStatus(412)));
	}

}