1 package org.onap.simulator.presetGenerator.presets.BasePresets;
3 import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest;
4 import org.springframework.http.HttpMethod;
6 import java.util.HashMap;
11 * Created by itzikliderman on 13/12/2017.
13 public abstract class BasePreset {
15 public RegistrationRequest generateScenario() {
16 Map<String, String> responseHeaders = new HashMap<>();
17 responseHeaders.put("Content-Type", getContentType());
19 return new RegistrationRequest(
20 new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody(), isStrictMatch(), getRequestHeaders()),
21 new RegistrationRequest.SimulatorResponse(getResponseCode(), responseHeaders, getResponseBody(), getFile()),
22 new RegistrationRequest.Misc(getNumberOfTimes(), getReplace()));
25 public Object getResponseBody() { return null; };
27 public String getContentType() {
28 return "application/json";
31 public String getFile() {
35 public int getResponseCode() { return 200; }
37 public abstract HttpMethod getReqMethod();
39 public abstract String getReqPath();
41 public Object getRequestBody() {
45 public boolean isStrictMatch() {
49 public Map<String, List> getQueryParams() { return null; }
51 protected abstract String getRootPath();
53 protected Integer getNumberOfTimes() {return null;}
55 protected boolean getReplace() {return true;}
57 public Map<String,String> getRequestHeaders() {
58 return new HashMap<>();