summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/simulators/src/main')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java (renamed from controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java)13
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java6
2 files changed, 13 insertions, 6 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
index 824c547ce..1ebb281fd 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/MsoSimulatorJaxRs.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
@@ -20,18 +20,25 @@
package org.onap.policy.simulators;
+import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
+import javax.ws.rs.core.MediaType;
+
+import org.onap.policy.so.SORequest;
+import org.onap.policy.so.util.Serialization;
@Path("/serviceInstances")
-public class MsoSimulatorJaxRs {
+public class SoSimulatorJaxRs {
@POST
@Path("/v2/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModulesHTTPS/1.1")
- public String msoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId)
+ @Consumes(MediaType.APPLICATION_JSON)
+ public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId, String req)
{
- return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": \"rq1234d1-5a33-ffdf-23ab-12abad84e331\"}}";
+ SORequest request = Serialization.gsonPretty.fromJson(req, SORequest.class);
+ return "{\"requestReferences\": {\"instanceId\": \"ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff\", \"requestId\": " + request.requestId + "}}";
}
}
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
index 27cc6e0fa..e0eb1ff01 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
@@ -22,7 +22,7 @@ package org.onap.policy.simulators;
import org.onap.policy.drools.http.server.HttpServletServer;
import org.onap.policy.simulators.AaiSimulatorJaxRs;
-import org.onap.policy.simulators.MsoSimulatorJaxRs;
+import org.onap.policy.simulators.SoSimulatorJaxRs;
import org.onap.policy.simulators.VfcSimulatorJaxRs;
public class Util {
@@ -33,9 +33,9 @@ public class Util {
return testServer;
}
- public static HttpServletServer buildMsoSim() throws InterruptedException {
+ public static HttpServletServer buildSoSim() throws InterruptedException {
HttpServletServer testServer = HttpServletServer.factory.build("testServer", "localhost", 6667, "/", false, true);
- testServer.addServletClass("/*", MsoSimulatorJaxRs.class.getName());
+ testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
return testServer;
}