summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-01-22 12:13:47 +0000
committerliamfallon <liam.fallon@ericsson.com>2018-01-22 16:27:17 +0000
commit45325103d88638ef5f1a4c5c7fdb785a182442c1 (patch)
tree03379ee107afba53d32779ff9deba85448cf3d8a /controlloop/common/simulators/src
parent3c7c997c6f081d749bc0973d1249a18356280e71 (diff)
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 <liam.fallon@ericsson.com>
Diffstat (limited to 'controlloop/common/simulators/src')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java24
1 files changed, 12 insertions, 12 deletions
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\"}]}}";
}
-
+
}