aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-17 20:20:02 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-17 20:20:02 +0000
commitf203526d0f86d385976da394bd1f0f918e4445d9 (patch)
tree89acfba916548ddc01b35a02cf12ae938a607155
parent99a909ac260e1277bdb8b0925fb9dd6aeb3acce5 (diff)
parentc2dbe84efeaf0f0db266a4c23380b209d93651d5 (diff)
Merge "Support vDNS RainyDay test Case."
-rw-r--r--models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java15
1 files changed, 12 insertions, 3 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 019d6f116..2e6f46b26 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
@@ -21,6 +21,9 @@
package org.onap.policy.simulators;
+import io.swagger.annotations.ApiParam;
+import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -34,13 +37,12 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import lombok.Setter;
import org.onap.policy.common.utils.resources.ResourceUtils;
-
+import org.onap.policy.so.SoRequest;
@Path("/")
public class SoSimulatorJaxRs {
private static final String REPLACE_ME = "${replaceMe}";
-
/**
* Set of incomplete request IDs. When a POST or DELETE is performed, the new request
* ID is added to the set. When the request is polled, the ID is removed and a "still
@@ -71,8 +73,15 @@ public class SoSimulatorJaxRs {
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
public String soPostQuery(@PathParam("serviceInstanceId") final String serviceInstanceId,
- @PathParam("vnfInstanceId") final String vnfInstanceId) {
+ @PathParam("vnfInstanceId") final String vnfInstanceId,
+ @ApiParam(required = true) SoRequest request) {
+ List<Map<String, String>> userParam = null;
+ userParam = request.getRequestDetails().getRequestParameters().getUserParams();
+ if (!userParam.isEmpty() && userParam.toString().contains("FAIL")) {
+ // this will be treated as a failure by the SO actor as it's missing the request ID
+ return "{}";
+ }
return (requirePolling ? makeStarted() : makeImmediateComplete());
}