aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java
new file mode 100644
index 000000000..162367368
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java
@@ -0,0 +1,47 @@
+package org.onap.simulator.presetGenerator.presets.BasePresets;
+
+import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest;
+import org.springframework.http.HttpMethod;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by itzikliderman on 13/12/2017.
+ */
+public abstract class BasePreset {
+
+ public RegistrationRequest generateScenario() {
+ Map<String, String> headers = new HashMap<>();
+ headers.put("Content-Type", getContentType());
+
+ return new RegistrationRequest(
+ new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody()),
+ new RegistrationRequest.SimulatorResponse(getResponseCode(), headers, getResponseBody(), getFile()));
+ }
+
+ public Object getResponseBody() { return null; };
+
+ public String getContentType() {
+ return "application/json";
+ }
+
+ public String getFile() {
+ return null;
+ }
+
+ public int getResponseCode() { return 200; }
+
+ public abstract HttpMethod getReqMethod();
+
+ public abstract String getReqPath();
+
+ public Object getRequestBody() {
+ return null;
+ }
+
+ public Map<String, List> getQueryParams() { return null; }
+
+ protected abstract String getRootPath();
+}