vid-automation selenium tests
[vid.git] / vid-automation / src / main / java / org / opencomp / simulator / presetGenerator / presets / BasePresets / BasePreset.java
1 package org.opencomp.simulator.presetGenerator.presets.BasePresets;
2
3 import org.opencomp.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> headers = new HashMap<>();
17         headers.put("Content-Type", getContentType());
18
19         return new RegistrationRequest(
20                 new RegistrationRequest.SimulatorRequest(getReqMethod(), getReqPath(), getQueryParams(), getRequestBody()),
21                 new RegistrationRequest.SimulatorResponse(getResponseCode(), headers, getResponseBody(), getFile()));
22     }
23
24     public Object getResponseBody() { return  null; };
25
26     public String getContentType() {
27         return "application/json";
28     }
29
30     public String getFile() {
31         return null;
32     }
33
34     public int getResponseCode() { return 200; }
35
36     public abstract HttpMethod getReqMethod();
37
38     public abstract String getReqPath();
39
40     public Object getRequestBody() {
41         return null;
42     }
43
44     public Map<String, List> getQueryParams() { return null; }
45
46     protected abstract String getRootPath();
47 }