From 45325103d88638ef5f1a4c5c7fdb785a182442c1 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 22 Jan 2018 12:13:47 +0000 Subject: Fix Tech Debt/JUnit on VFC actor Unit test for VFC actor added. Some minor chages to actor service provider class to remove technical debt. Change-Id: I54ee24bcfa1c82f4a18c0035bdff186d4d3ebdf7 Issue-ID: POLICY-455 Signed-off-by: liamfallon --- .../onap/policy/simulators/VfcSimulatorJaxRs.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'controlloop/common/simulators/src/main/java') diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java index 0602717c7..b8c0683d5 100644 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java @@ -35,26 +35,26 @@ import org.slf4j.LoggerFactory; @Path("/api/nslcm/v1") public class VfcSimulatorJaxRs { - + @POST @Path("/ns/{nsInstanceId}/heal") @Consumes(MediaType.APPLICATION_JSON) @Produces("application/json") public String vfcPostQuery(@PathParam("nsInstanceId") String nsInstanceId, - @Context final HttpServletResponse response) + @Context final HttpServletResponse response) { - response.setStatus(HttpServletResponse.SC_ACCEPTED); - try { - response.flushBuffer(); - }catch(Exception e){ - final Logger logger = LoggerFactory.getLogger(VfcSimulatorJaxRs.class); - logger.error("flushBuffer threw: ", e); - return ""; - } + response.setStatus(HttpServletResponse.SC_ACCEPTED); + try { + response.flushBuffer(); + } catch(Exception e){ + final Logger logger = LoggerFactory.getLogger(VfcSimulatorJaxRs.class); + logger.error("flushBuffer threw: ", e); + return ""; + } return "{\"jobId\":\"1\"}"; } - + @GET @Path("/jobs/{jobId}") @Consumes(MediaType.APPLICATION_JSON) @@ -62,6 +62,6 @@ public class VfcSimulatorJaxRs { public String vfcGetQuery(@PathParam("jobId") String jobId) { return "{\"jobId\" : "+jobId+",\"responseDescriptor\" : {\"progress\" : \"40\",\"status\" : \"finished\",\"statusDescription\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\": 101 ,\"responseHistoryList\": [{\"progress\" : \"40\",\"status\" : \"proccessing\",\"statusDescription\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"1\"}, {\"progress\" : \"41\",\"status\" : \"proccessing\",\"statusDescription\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"2\"}]}}"; } - + } -- cgit 1.2.3-korg