1 package org.onap.simulator.presetGenerator.presets.aai;
3 import com.google.common.collect.ImmutableMap;
4 import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
5 import org.springframework.http.HttpMethod;
7 import java.util.Collections;
11 import static vid.automation.test.utils.ReadFile.loadResourceAsString;
13 public class PresetAAIGetSubDetailsGet extends BaseAAIPreset {
14 private String subscriberId;
15 private String responseBody;
17 private static final String baseResponseBody = loadResourceAsString("presets_templates/PresetAAIGetSubDetailsGet.json");
18 private static final String GLOBAL_CUSTOMER_ID = "GLOBAL_CUSTOMER_ID";
19 private static final String ORCH_STATUS = "<ORCH_STATUS>";
21 public PresetAAIGetSubDetailsGet(String subscriberId) {
22 this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId;
23 this.responseBody = baseResponseBody.replace(GLOBAL_CUSTOMER_ID, this.subscriberId);
26 public PresetAAIGetSubDetailsGet(String subscriberId, String orchStatus) {
27 this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId;
28 this.responseBody = baseResponseBody.replace(GLOBAL_CUSTOMER_ID, this.subscriberId);
29 this.responseBody = this.responseBody.replace("\"subscriber-name\":\"Emanuel\"", "\"subscriber-name\":\"SILVIA ROBBINS\"");
30 this.responseBody = this.responseBody.replaceAll(ORCH_STATUS, orchStatus);
34 public Map<String, List> getQueryParams() {
35 return ImmutableMap.of("depth", Collections.singletonList("2"));
39 public Object getResponseBody() {
44 public HttpMethod getReqMethod() {
45 return HttpMethod.GET;
49 public String getReqPath() {
50 return getRootPath() + "/business/customers/customer/" + getSubscriberId();
53 public String getSubscriberId() {