1 package org.onap.simulator.presetGenerator.presets.BasePresets;
3 import java.util.HashMap;
6 import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest;
7 import org.springframework.http.HttpMethod;
10 * Created by itzikliderman on 13/12/2017.
12 public abstract class BasePreset {
14 public RegistrationRequest generateScenario() {
15 Map<String, String> responseHeaders = new HashMap<>();
16 responseHeaders.put("Content-Type", getContentType());
18 return new RegistrationRequest(
19 new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody(), isStrictMatch(), getRequestHeaders()),
20 new RegistrationRequest.SimulatorResponse(getResponseCode(), responseHeaders, getResponseBody(), getFile()),
21 new RegistrationRequest.Misc(getNumberOfTimes(), getReplace()));
24 public Object getResponseBody() { return null; };
26 public String getContentType() {
27 return "application/json";
30 public String getFile() {
34 public int getResponseCode() { return 200; }
36 public abstract HttpMethod getReqMethod();
38 public abstract String getReqPath();
40 public Object getRequestBody() {
44 public boolean isStrictMatch() {
48 public Map<String, List> getQueryParams() { return null; }
50 protected abstract String getRootPath();
52 protected Integer getNumberOfTimes() {return null;}
54 protected boolean getReplace() {return true;}
56 public Map<String,String> getRequestHeaders() {
57 return new HashMap<>();