Merge from ecomp 718fd196 - Integration Tests
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / aai / PresetAAIGetModelsByProject.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 import java.util.UUID;
11
12 public class PresetAAIGetModelsByProject extends BaseAAIPreset {
13     private String projectName;
14     private String serviceInstanceId;
15
16     public PresetAAIGetModelsByProject(String projectName) {
17         this.projectName = projectName;
18         ImmutableMap servicesPerProject = ImmutableMap.of ("x1","7e4f8130-5dee-47c4-8770-1abc5f5ded83",
19                 "yyy1","13695dfb-db99-4c2f-905e-fe7bf2fc7b9f");
20         this.serviceInstanceId = (servicesPerProject.containsKey(projectName)) ? servicesPerProject.get(projectName).toString(): UUID.randomUUID().toString();
21     }
22
23     @Override
24     public HttpMethod getReqMethod() {
25         return HttpMethod.GET;
26     }
27
28     @Override
29     public String getReqPath() {
30         return getRootPath() + "/business/projects";
31     }
32
33     @Override
34     public Map<String, List> getQueryParams() {
35         return ImmutableMap.of(
36                 "project-name", Collections.singletonList(projectName)
37         );
38     }
39
40     @Override
41     public Object getResponseBody() {
42         return "{" +
43                 "  \"project\": [" +
44                 "    {" +
45                 "      \"project-name\": \"" + projectName + "\"," +
46                 "      \"resource-version\": \"1527026201826\"," +
47                 "      \"relationship-list\": {" +
48                 "        \"relationship\": [" +
49                 "          {" +
50                 "            \"related-to\": \"service-instance\"," +
51                 "            \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
52                 "            \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/3f826016-3ac9-4928-9561-beee75fd91d5\"," +
53                 "            \"relationship-data\": [" +
54                 "              {" +
55                 "                \"relationship-key\": \"customer.global-customer-id\"," +
56                 "                \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
57                 "              }," +
58                 "              {" +
59                 "                \"relationship-key\": \"service-subscription.service-type\"," +
60                 "                \"relationship-value\": \"Emanuel\"" +
61                 "              }," +
62                 "              {" +
63                 "                \"relationship-key\": \"service-instance.service-instance-id\"," +
64                 "                \"relationship-value\": \"3f826016-3ac9-4928-9561-beee75fd91d5\"" +
65                 "              }" +
66                 "            ]," +
67                 "            \"related-to-property\": [" +
68                 "              {" +
69                 "                \"property-key\": \"service-instance.service-instance-name\"," +
70                 "                \"property-value\": \"Lital_SRIOV2_001\"" +
71                 "              }" +
72                 "            ]" +
73                 "          }," +
74                 "          {" +
75                 "            \"related-to\": \"service-instance\"," +
76                 "            \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
77                 "            \"related-link\": \"/aai/v12/business/customers/customer/DHV1707-TestSubscriber-2/service-subscriptions/service-subscription/HNGATEWAY/service-instances/service-instance/45713f81-04b8-4fd0-b824-64536d493984\"," +
78                 "            \"relationship-data\": [" +
79                 "              {" +
80                 "                \"relationship-key\": \"customer.global-customer-id\"," +
81                 "                \"relationship-value\": \"DHV1707-TestSubscriber-2\"" +
82                 "              }," +
83                 "              {" +
84                 "                \"relationship-key\": \"service-subscription.service-type\"," +
85                 "                \"relationship-value\": \"HNGATEWAY\"" +
86                 "              }," +
87                 "              {" +
88                 "                \"relationship-key\": \"service-instance.service-instance-id\"," +
89                 "                \"relationship-value\": \"45713f81-04b8-4fd0-b824-64536d493984\"" +
90                 "              }" +
91                 "            ]," +
92                 "            \"related-to-property\": [" +
93                 "              {" +
94                 "                \"property-key\": \"service-instance.service-instance-name\"," +
95                 "                \"property-value\": \"kkkk\"" +
96                 "              }" +
97                 "            ]" +
98                 "          }," +
99                 "          {" +
100                 "            \"related-to\": \"service-instance\"," +
101                 "            \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," +
102                 "            \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vMOG/service-instances/service-instance/" + serviceInstanceId + "\"," +
103                 "            \"relationship-data\": [" +
104                 "              {" +
105                 "                \"relationship-key\": \"customer.global-customer-id\"," +
106                 "                \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
107                 "              }," +
108                 "              {" +
109                 "                \"relationship-key\": \"service-subscription.service-type\"," +
110                 "                \"relationship-value\": \"vMOG\"" +
111                 "              }," +
112                 "              {" +
113                 "                \"relationship-key\": \"service-instance.service-instance-id\"," +
114                 "                \"relationship-value\": \"" + serviceInstanceId + "\"" +
115                 "              }" +
116                 "            ]," +
117                 "            \"related-to-property\": [" +
118                 "              {" +
119                 "                \"property-key\": \"service-instance.service-instance-name\"," +
120                 "                \"property-value\": \"FIRSTNET_DEMO\"" +
121                 "              }" +
122                 "            ]" +
123                 "          }," +
124                 "          {" +
125                 "            \"related-to\": \"service-instance\"," +
126                 "            \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
127                 "            \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/ff2d9326-1ef5-4760-aba0-0eaf372ae675\"," +
128                 "            \"relationship-data\": [" +
129                 "              {" +
130                 "                \"relationship-key\": \"customer.global-customer-id\"," +
131                 "                \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
132                 "              }," +
133                 "              {" +
134                 "                \"relationship-key\": \"service-subscription.service-type\"," +
135                 "                \"relationship-value\": \"Emanuel\"" +
136                 "              }," +
137                 "              {" +
138                 "                \"relationship-key\": \"service-instance.service-instance-id\"," +
139                 "                \"relationship-value\": \"ff2d9326-1ef5-4760-aba0-0eaf372ae675\"" +
140                 "              }" +
141                 "            ]," +
142                 "            \"related-to-property\": [" +
143                 "              {" +
144                 "                \"property-key\": \"service-instance.service-instance-name\"," +
145                 "                \"property-value\": \"VNF_INSTANCE_DEMO_THREE\"" +
146                 "              }" +
147                 "            ]" +
148                 "          }" +
149                 "        ]" +
150                 "      }" +
151                 "    }" +
152                 "  ]" +
153                 "}";
154     }
155
156
157 }