summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-11-09 04:03:10 +0000
committerGerrit Code Review <gerrit@onap.org>2017-11-09 04:03:10 +0000
commit40d761966d4c867007015c894b5dd783edf96cfd (patch)
tree70365857e1de82b7bfd5efadce34677db0267df4 /controlloop/common/simulators
parentb444334ec9d80aabb6dc7cefae1f2dfd3dd62577 (diff)
parent48c62738bf4c5653e36c6ea1e8e33e649b8526fc (diff)
Merge "Fix SO Request body"
Diffstat (limited to 'controlloop/common/simulators')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java12
-rw-r--r--controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java6
2 files changed, 9 insertions, 9 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
index 2dd4d0908..e70a88517 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
@@ -27,9 +27,6 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-import org.onap.policy.so.SORequest;
-import org.onap.policy.so.util.Serialization;
-
@Path("/serviceInstances")
public class SoSimulatorJaxRs {
@@ -37,10 +34,13 @@ public class SoSimulatorJaxRs {
@Path("/v5/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, String req)
+ public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId)
{
- SORequest request = Serialization.gsonPretty.fromJson(req, SORequest.class);
- return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": " + request.requestId + "}}";
+
+ // the requestID contained in the SO Response is a newly generated requestID
+ // with no relation to the requestID in Policy controlLoopEvent
+ return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": \"rq1234d1-5a33-ffdf-23ab-12abad84e331\" }}";
+
}
}
diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
index 090236c40..3e5af3891 100644
--- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
+++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
@@ -86,7 +86,7 @@ public class SoSimulatorTest {
//
request.requestDetails.modelInfo.modelType = "vfModule";
request.requestDetails.modelInfo.modelInvariantId = "f32568ec-2f1c-458a-864b-0593d53d141a";
- request.requestDetails.modelInfo.modelNameVersionId = "69615025-879d-4f0d-afe3-b7d1a7eeed1f";
+ request.requestDetails.modelInfo.modelVersionId = "69615025-879d-4f0d-afe3-b7d1a7eeed1f";
request.requestDetails.modelInfo.modelName = "C15ce9e1E9144c8fB8bb..dnsscaling..module-1";
request.requestDetails.modelInfo.modelVersion = "1.0";
//
@@ -111,7 +111,7 @@ public class SoSimulatorTest {
relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "service";
relatedInstanceListElement1.relatedInstance.modelInfo.modelInvariantId =
"4fcbc1c0-7793-46d8-8aa1-fa1c2ed9ec7b";
- relatedInstanceListElement1.relatedInstance.modelInfo.modelNameVersionId =
+ relatedInstanceListElement1.relatedInstance.modelInfo.modelVersionId =
"5c996219-b2e2-4c76-9b43-7e8672a33c1d";
relatedInstanceListElement1.relatedInstance.modelInfo.modelName = "8330e932-2a23-4943-8606";
relatedInstanceListElement1.relatedInstance.modelInfo.modelVersion = "1.0";
@@ -121,7 +121,7 @@ public class SoSimulatorTest {
relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "vnf";
relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId =
"033a32ed-aa65-4764-a736-36f2942f1aa0";
- relatedInstanceListElement2.relatedInstance.modelInfo.modelNameVersionId =
+ relatedInstanceListElement2.relatedInstance.modelInfo.modelVersionId =
"d4d072dc-4e21-4a03-9524-628985819a8e";
relatedInstanceListElement2.relatedInstance.modelInfo.modelName = "c15ce9e1-e914-4c8f-b8bb";
relatedInstanceListElement2.relatedInstance.modelInfo.modelVersion = "1";