aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-05-15 14:46:15 -0400
committerJim Hahn <jrh3@att.com>2020-05-15 14:52:15 -0400
commit5210055db2f00f42fea4717b2726dda52e1c1a59 (patch)
tree435bf700d4f5096b23126f899ab36fe3cc0de888 /models-interactions/model-simulators/src/main/java
parentafe5abed95c6cbfe239066e267d9c10a71f20623 (diff)
Cannot parse finishTime in legacy SO responses
Adding the actual sample responses to the SO simulator broke the drools-apps junit for usecases. Fixed (in theory) by updating the legacy SO actor to properly decode the finishTime. Refactored the new SO actor, extracting the type adapter into its own class file so it could be shared between the new and legacy actors. Issue-ID: POLICY-2570 Change-Id: I061b603172440b1a91da16d09b4f2a0d289dfc41 Signed-off-by: Jim Hahn <jrh3@att.com>
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);