summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/simulators')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
index f5a4f6e53..3dd8347f2 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
@@ -42,6 +42,8 @@ import org.onap.policy.aai.util.Serialization;
@Path("/aai")
public class AaiSimulatorJaxRs {
+ private static final String VSERVER = "vserver";
+
/**
* A&AI get query.
*
@@ -72,12 +74,12 @@ public class AaiSimulatorJaxRs {
public String aaiPostQuery(final String req) throws IOException {
final AaiNqRequest request = Serialization.gsonPretty.fromJson(req, AaiNqRequest.class);
- if (request.getInstanceFilters().getInstanceFilter().get(0).containsKey("vserver")) {
+ if (request.getInstanceFilters().getInstanceFilter().get(0).containsKey(VSERVER)) {
final String vserverName =
- request.getInstanceFilters().getInstanceFilter().get(0).get("vserver").get("vserver-name");
+ request.getInstanceFilters().getInstanceFilter().get(0).get(VSERVER).get("vserver-name");
if ("error".equals(vserverName)) {
Map<String,String> params = new TreeMap<>();
- params.put("type", "vserver");
+ params.put("type", VSERVER);
return load("aai/AaiNqResponse-Error.json", params);
} else {
// vll format - new