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