diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-09-14 18:26:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-14 18:26:20 +0000 |
commit | d75fd4d5cafa652fa35d6c152f114319b27f7603 (patch) | |
tree | 78a9d70d07b8aeaa2ca3fd2e02d18528902c3cdc /controlloop/common/simulators/src/main | |
parent | 0f7e3fb817487b85a4200eb39a5755888c5ad04b (diff) | |
parent | c5f38f5de2f49d3f2fa7f03808f9f063f1cb2ed9 (diff) |
Merge "Added changes for vDNS Use Case"
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.java | 6 |
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; } |