Merge "Fix getManualTasks double-addition of baseUrl"
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / aai / PresetAAIGetSubDetailsWithoutInstancesGetSpecificService.java
1 package org.onap.simulator.presetGenerator.presets.aai;
2
3 import com.google.common.collect.ImmutableMap;
4 import java.util.Collections;
5 import java.util.List;
6 import java.util.Map;
7 import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
8 import org.springframework.http.HttpMethod;
9
10 public class PresetAAIGetSubDetailsWithoutInstancesGetSpecificService extends BaseAAIPreset {
11     private String subscriberId;
12     private String subscriberName = "Emanuel";
13
14     public PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(String subscriberId) {
15         this.subscriberId = subscriberId == null ? "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb" : subscriberId;
16     }
17
18     public PresetAAIGetSubDetailsWithoutInstancesGetSpecificService(String subscriberId, String subscriberName) {
19         this(subscriberId);
20         this.subscriberName = subscriberName;
21     }
22
23     @Override
24     public Map<String, List> getQueryParams() {
25         return ImmutableMap.of("depth",  Collections.singletonList("1"));
26     }
27
28     @Override
29     public HttpMethod getReqMethod() {
30         return HttpMethod.GET;
31     }
32
33     @Override
34     public String getReqPath() {
35         return getRootPath() + "/business/customers/customer/" + getSubscriberId();
36     }
37
38     public String getSubscriberId() {
39         return subscriberId;
40     }
41
42     @Override
43     public Object getResponseBody() {
44         return "{" +
45                 "  \"global-customer-id\":\""+this.subscriberId+"\"," +
46                 "  \"subscriber-name\":\""+this.subscriberName+"\"," +
47                 "  \"subscriber-type\":\"INFRA\"," +
48                 "  \"resource-version\":\"1494255056308\"," +
49                 "  \"service-subscriptions\":{" +
50                 "    \"service-subscription\":[" +
51                 "      {" +
52                 "        \"service-type\":\"vFlowLogic\"," +
53                 "        \"resource-version\":\"1501700976809\"," +
54                 "        \"is-permitted\":false" +
55                 "      }," +
56                 "      {" +
57                 "        \"service-type\":\"TYLER SILVIA\"," +
58                 "        \"resource-version\":\"1501700976809\"," +
59                 "        \"is-permitted\":false" +
60                 "      }" +
61                 "    ]" +
62                 "  }" +
63                 "}";
64     }
65
66 }
67