From 4a4dcc5185f8ba5a28c7f9fef509f32c0c2389e6 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Sun, 12 Aug 2018 14:51:28 +0300 Subject: vid-automation selenium tests Change-Id: I6c1b0a0cf3bbfa4314c81f0cc72507db805ec632 Issue-ID: VID-281 Signed-off-by: Sonsino, Ofir (os0695) --- .../presets/aai/PresetAAIGetSubDetailsGet.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java (limited to 'vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java') diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java new file mode 100644 index 000000000..5b9f2ff96 --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetSubDetailsGet.java @@ -0,0 +1,46 @@ +package org.opencomp.simulator.presetGenerator.presets.aai; + +import org.opencomp.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static vid.automation.test.utils.ReadFile.loadResourceAsString; + +public class PresetAAIGetSubDetailsGet extends BaseAAIPreset { + private String subscriberId; + private String responseBody; + + private static final String baseResponseBody = loadResourceAsString("presets_templates/PresetAAIGetSubDetailsGet.json"); + private static final String GLOBAL_CUSTOMER_ID = "GLOBAL_CUSTOMER_ID"; + + public PresetAAIGetSubDetailsGet(String subscriberId) { + this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId; + this.responseBody = baseResponseBody.replace(GLOBAL_CUSTOMER_ID, this.subscriberId); + } + + public void mapQueryParams(Map map) { + map.put("depth", Collections.singletonList("2")); + } + + @Override + public Object getResponseBody() { + return responseBody; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return getRootPath() + "/business/customers/customer/" + getSubscriberId(); + } + + public String getSubscriberId() { + return subscriberId; + } +} -- cgit 1.2.3-korg