From 43dc0ba3222a5751a1ea4ae06ed70262f3b061a7 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Thu, 21 Sep 2017 15:25:28 -0400 Subject: Initial commit of vCPE flows Note: vCpeResCust isn't done yet. Waiting for Homing BB integration. Change-Id: I9c6bcbd13eb1857085cb44d9aabe96ffb600b9a1 Issue-id: SO-147 Signed-off-by: Rob Daugherty --- .../openecomp/mso/bpmn/mock/StubResponseAAI.java | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'bpmn/MSOMockServer') diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java index 06437fe53e..a9ec38455b 100644 --- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java +++ b/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java @@ -34,6 +34,7 @@ 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 * @@ -58,6 +59,14 @@ public class StubResponseAAI { /** * 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() @@ -69,6 +78,26 @@ public class StubResponseAAI { .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))); + } /** @@ -199,7 +228,6 @@ public class StubResponseAAI { .withStatus(500))); } - /** * Service-Subscription Mock StubResponses below */ @@ -795,6 +823,14 @@ public class StubResponseAAI { .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)) -- cgit 1.2.3-korg