aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOMockServer/src
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2017-09-21 15:25:28 -0400
committerRob Daugherty <rd472p@att.com>2017-09-21 15:25:28 -0400
commit43dc0ba3222a5751a1ea4ae06ed70262f3b061a7 (patch)
treef6fee89cfe19164d1b0434f8b7877e178489e684 /bpmn/MSOMockServer/src
parent4d8773a237d3c0b94b8aac3250946b7fff77fd62 (diff)
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 <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOMockServer/src')
-rw-r--r--bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java38
1 files changed, 37 insertions, 1 deletions
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))