summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-03-11 09:34:34 +0200
committerIttay Stern <ittay.stern@att.com>2019-03-17 17:02:43 +0200
commit66af8b9b391879be78660d6ccb0a1f1f9340b423 (patch)
treefc0d510f7ea28a437bcb1e3b950d1281ac88a4e4 /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java
parent37ad0cc1d36ec6ff68ec39fcaaf2617eef7d08fe (diff)
Merge automation from ECOMP's repository
Reference commit in ECOMP: 8e92a8c6 Issue-ID: VID-378 Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java
new file mode 100644
index 000000000..29e7d5092
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java
@@ -0,0 +1,46 @@
+package org.onap.simulator.presetGenerator.presets.aai;
+
+import com.google.common.collect.ImmutableMap;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public class PresetAAISearchNodeQueryNonEmptyResult extends PresetAAIBaseSearchNodeQuery {
+
+ private final String type;
+ private final String name;
+
+ public PresetAAISearchNodeQueryNonEmptyResult(String type, String name) {
+ this.type = type;
+ this.name = name;
+ }
+
+ @Override
+ public Object getResponseBody() {
+ return "{ \"something\": [] }";
+ }
+
+ @Override
+ public int getResponseCode() {
+ return 200;
+ }
+
+ @Override
+ public String getReqPath() {
+ return getRootPath() + "/nodes/" + searchPath();
+ }
+
+ @Override
+ public Map<String, List> getQueryParams() {
+ return ImmutableMap.of(searchKey(), Collections.singletonList(name));
+ }
+
+ private String searchPath() {
+ return type + "s";
+ }
+
+ private String searchKey() {
+ return type + "-name";
+ }
+}