Merge from ecomp 718fd196 - Integration Tests
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / BasePresets / BasePreset.java
1 package org.onap.simulator.presetGenerator.presets.BasePresets;
2
3 import org.onap.simulator.presetGenerator.presets.model.RegistrationRequest;
4 import org.springframework.http.HttpMethod;
5
6 import java.util.HashMap;
7 import java.util.List;
8 import java.util.Map;
9
10 /**
11  * Created by itzikliderman on 13/12/2017.
12  */
13 public abstract class BasePreset {
14
15     public RegistrationRequest generateScenario() {
16         Map<String, String> responseHeaders = new HashMap<>();
17         responseHeaders.put("Content-Type", getContentType());
18
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()));
23     }
24
25     public Object getResponseBody() { return  null; };
26
27     public String getContentType() {
28         return "application/json";
29     }
30
31     public String getFile() {
32         return null;
33     }
34
35     public int getResponseCode() { return 200; }
36
37     public abstract HttpMethod getReqMethod();
38
39     public abstract String getReqPath();
40
41     public Object getRequestBody() {
42         return null;
43     }
44
45     public boolean isStrictMatch() {
46         return false;
47     }
48
49     public Map<String, List> getQueryParams() { return null; }
50
51     protected abstract String getRootPath();
52
53     protected Integer getNumberOfTimes() {return null;}
54
55     protected boolean getReplace()  {return true;}
56
57     public Map<String,String> getRequestHeaders() {
58         return new HashMap<>();
59     }
60 }