From 66af8b9b391879be78660d6ccb0a1f1f9340b423 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 11 Mar 2019 09:34:34 +0200 Subject: Merge automation from ECOMP's repository Reference commit in ECOMP: 8e92a8c6 Issue-ID: VID-378 Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48 Signed-off-by: Ittay Stern --- .../PresetAAISearchNodeQueryNonEmptyResult.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAISearchNodeQueryNonEmptyResult.java') 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 getQueryParams() { + return ImmutableMap.of(searchKey(), Collections.singletonList(name)); + } + + private String searchPath() { + return type + "s"; + } + + private String searchKey() { + return type + "-name"; + } +} -- cgit 1.2.3-korg