X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Ftest%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fbpmn%2Fmock%2FStubResponseAAI.java;h=6efd99256621c38c7980cd13fca874fca76179a5;hb=b6dc38501f3b746426b42d9de4cc883d894149e8;hp=f9a6543387ca460943811aaa42862458f253e772;hpb=6f0a1ef3e4b8891c670c289cfc13219031d25341;p=so.git diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java index f9a6543387..6efd992566 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java @@ -826,6 +826,14 @@ public class StubResponseAAI { .withBodyFile(responseFile))); } + public static void MockGetVfModuleByName(String vnfId, String vfModuleName, 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)) + .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)) @@ -867,7 +875,7 @@ public class StubResponseAAI { /* AAI Pserver Queries */ public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) { - stubFor(put(urlMatching("/v10/query.*")) + stubFor(put(urlMatching("/aai/v1[0-9]/query.*")) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "application/json") @@ -875,7 +883,7 @@ public class StubResponseAAI { } public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) { - stubFor(get(urlMatching("/v10/network/generic-vnfs/.*")) + stubFor(get(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*")) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "application/json; charset=utf-8") @@ -883,12 +891,28 @@ public class StubResponseAAI { } public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) { - stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*")) + stubFor(patch(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*")) + .willReturn(aResponse() + .withStatus(statusCode) + )); + } + + public static void MockSetInMaintFlagByVnfId(String vnfId, String responseFile, int statusCode) { + stubFor(post(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*")) .willReturn(aResponse() .withStatus(statusCode) + .withBodyFile(responseFile) )); } + public static void MockGetDefaultCloudRegionByCloudRegionId(String cloudRegionId, String responseFile, int statusCode) { + stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegionId + ".*")) + .willReturn(aResponse() + .withStatus(statusCode) + .withHeader("Content-Type", "application/json; charset=utf-8") + .withBodyFile(responseFile))); + } + //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above //// @Deprecated public static void MockGetVceById(){