aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BasePreset.java
blob: 16236736845b70ad6f122c527a7f4d8f274a462d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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();
}