summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators/src/main
diff options
context:
space:
mode:
authorHockla, Ali (ah999m) <ah999m@att.com>2017-09-13 09:24:43 -0500
committerAli Hockla <ah999m@att.com>2017-09-14 15:03:17 +0000
commitc5f38f5de2f49d3f2fa7f03808f9f063f1cb2ed9 (patch)
tree93454ef45c37e7b033b45918ef2e1da0050980cb /controlloop/common/simulators/src/main
parentbc4267d043427c080b1cc1fe42ea0860bed9fa97 (diff)
Added changes for vDNS Use Case
-Renamed remaining MSO classes and packages to SO and modified drl accordingly -Connected SO Interface to SO Simulator -Added vDNS Control Loop junit -Modified SOActorServiceProvider to reflect AAI class changes (POLICY-103) Issue-ID: POLICY-102 Change-Id: Iea5d3f096c4ccfedde68e79d7593d66331127aaf Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
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;
}