summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-simulators/src/main/java')
-rw-r--r--models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
index d83f5a54e..019d6f116 100644
--- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
+++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
@@ -73,7 +73,7 @@ public class SoSimulatorJaxRs {
public String soPostQuery(@PathParam("serviceInstanceId") final String serviceInstanceId,
@PathParam("vnfInstanceId") final String vnfInstanceId) {
- return (requirePolling ? makeStarted() : makeComplete(UUID.randomUUID().toString()));
+ return (requirePolling ? makeStarted() : makeImmediateComplete());
}
/**
@@ -91,7 +91,7 @@ public class SoSimulatorJaxRs {
@PathParam("vnfInstanceId") final String vnfInstanceId,
@PathParam("vfModuleInstanceId") final String vfModuleInstanceId) {
- return (requirePolling ? makeStarted() : makeComplete(UUID.randomUUID().toString()));
+ return (requirePolling ? makeStarted() : makeImmediateComplete());
}
/**
@@ -124,6 +124,11 @@ public class SoSimulatorJaxRs {
return response.replace(REPLACE_ME, requestId);
}
+ private String makeImmediateComplete() {
+ String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.immediate.success.json");
+ return response.replace(REPLACE_ME, UUID.randomUUID().toString());
+ }
+
private String makeComplete(String requestId) {
String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/so/so.complete.success.json");
return response.replace(REPLACE_ME, requestId);