2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.crud.service;
23 import static org.mockito.Mockito.mock;
24 import static org.mockito.Mockito.when;
25 import java.util.ArrayList;
26 import java.util.Arrays;
27 import java.util.HashMap;
28 import java.util.List;
30 import javax.ws.rs.core.MediaType;
31 import javax.ws.rs.core.MultivaluedHashMap;
32 import javax.ws.rs.core.MultivaluedMap;
33 import org.onap.aai.logging.LoggingContext;
34 import org.onap.aai.restclient.client.OperationResult;
35 import org.onap.aai.restclient.client.RestClient;
36 import org.onap.crud.dao.champ.ChampDao;
39 public class ChampDaoMockTest {
41 private final String champVertex = "{" +
42 "\"key\": \"test-uuid\"," +
43 "\"type\": \"vertexType\"," +
45 "\"fqdn\": \"myhost.onap.com\"," +
46 "\"hostname\": \"myhost\" } }";
48 private final String champEdge = "{" +
49 "\"key\": \"test-uuid\"," +
50 "\"type\": \"edgeType\"," +
52 "\"prevent-delete\": \"NONE\" }," +
54 "\"key\": \"50bdab41-ad1c-4d00-952c-a0aa5d827811\", \"type\": \"vserver\"}," +
56 "\"key\": \"1d326bc7-b985-492b-9604-0d5d1f06f908\", \"type\": \"pserver\"}" +
59 private final String edgePayload = "{" +
60 "\"type\":\"tosca.relationships.HostedOn\"," +
62 "\"prevent-delete\":\"NONE\"}," +
64 "\"key\":\"test-uuid\"," +
65 "\"type\":\"vserver\"," +
66 "\"properties\":{}}," +
68 "\"key\":\"test-uuid\"," +
69 "\"type\":\"pserver\"," +
71 "\"hostname\":\"myhost\"," +
72 "\"fqdn\":\"myhost.onap.com\"}}}";
74 private final String edgePayloadForPut = "{" +
75 "\"key\":\"test-uuid\"," +
76 "\"type\":\"tosca.relationships.HostedOn\"," +
78 "\"prevent-delete\":\"NONE\"}," +
80 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
81 "\"type\":\"vserver\"," +
82 "\"properties\":{}}," +
84 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
85 "\"type\":\"pserver\"," +
86 "\"properties\":{}}}";
88 private final String edgePayloadForPatch = "{" +
89 "\"key\":\"test-uuid\"," +
90 "\"type\":\"tosca.relationships.HostedOn\"," +
92 "\"prevent-delete\":\"NONE\"}," +
94 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
95 "\"type\":\"vserver\"}," +
97 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
98 "\"type\":\"pserver\"}}";
100 private final String edgePayloadForPost = "{" +
101 "\"type\":\"tosca.relationships.HostedOn\"," +
103 "\"SVC-INFRA\":\"OUT\"," +
104 "\"prevent-delete\":\"IN\"," +
105 "\"delete-other-v\":\"NONE\"," +
106 "\"contains-other-v\":\"NONE\"" +
109 "\"key\":\"test-uuid\"," +
110 "\"type\":\"vserver\"," +
116 "\"key\":\"test-uuid\"," +
117 "\"type\":\"pserver\"," +
119 "\"hostname\":\"myhost\"," +
120 "\"fqdn\":\"myhost.onap.com\"" +
125 private final String edgePayloadForPutNoProperties = "{" +
126 "\"key\":\"test-uuid\"," +
127 "\"type\":\"tosca.relationships.HostedOn\"," +
129 "\"SVC-INFRA\":\"OUT\"," +
130 "\"prevent-delete\":\"IN\"," +
131 "\"delete-other-v\":\"NONE\"," +
132 "\"contains-other-v\":\"NONE\"" +
135 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
136 "\"type\":\"vserver\"," +
142 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
143 "\"type\":\"pserver\"," +
150 private final String vertexPayload = "{" +
151 "\"type\":\"pserver\"," +
153 "\"hostname\":\"myhost\"," +
154 "\"in-maint\":false," +
155 "\"fqdn\":\"myhost.onap.com\"," +
156 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
157 "\"source-of-truth\":\"source-of-truth\"," +
158 "\"aai-node-type\":\"pserver\"}}";
160 private final String vertexPayloadForVserver = "{" +
161 "\"type\":\"vserver\"," +
163 "\"in-maint\":false," +
164 "\"vserver-name\":\"test-vserver\"," +
165 "\"vserver-id\":\"VSER1\"," +
166 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
167 "\"vserver-name2\":\"alt-test-vserver\"," +
168 "\"source-of-truth\":\"source-of-truth\"," +
169 "\"vserver-selflink\":\"http://1.2.3.4/moreInfo\"," +
170 "\"is-closed-loop-disabled\":false," +
171 "\"aai-node-type\":\"vserver\"}}";
173 private final String vertexPayloadForPserver = "{" +
174 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
175 "\"type\":\"pserver\"," +
177 "\"ptnii-equip-name\":\"e-name\"," +
178 "\"hostname\":\"steve-host2\"," +
179 "\"equip-type\":\"server\"," +
180 "\"equip-vendor\":\"HP\"," +
181 "\"equip-model\":\"DL380p-nd\"," +
182 "\"in-maint\":false," +
183 "\"fqdn\":\"myhost.onap.net\"," +
184 "\"purpose\":\"my-purpose\"," +
185 "\"ipv4-oam-address\":\"1.2.3.4\"," +
186 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
187 "\"aai-node-type\":\"pserver\"}}";
189 private final String vertexPayloadForPut = "{" +
190 "\"key\":\"test-uuid\"," +
191 "\"type\":\"pserver\"," +
193 "\"hostname\":\"myhost\"," +
194 "\"in-maint\":false," +
195 "\"fqdn\":\"myhost.onap.com\"," +
196 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
197 "\"aai-node-type\":\"pserver\"}}";
199 private final String vertexPayloadForPatch = "{" +
200 "\"key\":\"test-uuid\"," +
201 "\"type\":\"pserver\"," +
203 "\"hostname\":\"myhost\"," +
204 "\"fqdn\":\"myhost.onap.com\"," +
205 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
206 "\"aai-node-type\":\"pserver\"}}";
209 private RestClient restClientMock;
210 private ChampDao champDao;
212 static final String CHAMP_URL = "https://host:9522/services/champ-service/v1/";
213 static final String OBJECT_SUB_URL = "objects";
214 static final String RELATIONSHIP_SUB_URL = "relationships";
215 static final String TRANSACTION_SUB_URL = "transaction";
216 static final String BASE_OBJECT_URL = CHAMP_URL + OBJECT_SUB_URL;
217 static final String HEADER_FROM_APP = "X-FromAppId";
218 static final String HEADER_TRANS_ID = "X-TransactionId";
219 static final String FROM_APP_NAME = "Gizmo";
220 static final String HEADER_TRANS_ID_VALUE = "1234567890";
223 restClientMock = mock(RestClient.class);
230 Map<String, String> queryParamsVertex = new HashMap<>();
231 queryParamsVertex.put("_reserved_version", "v11");
232 queryParamsVertex.put("hostname", "myhost");
233 queryParamsVertex.put("_reserved_aai-type", "pserver");
235 Map<String, String> queryParamsVertexV13 = new HashMap<>();
236 queryParamsVertexV13.put("_reserved_version", "v13");
237 queryParamsVertexV13.put("hostname", "myhost");
238 queryParamsVertexV13.put("_reserved_aai-type", "pserver");
240 Map<String, String> queryParamsVertices = new HashMap<>();
241 queryParamsVertices.put("_reserved_version", "v11");
242 queryParamsVertices.put("hostname", "myhost");
243 queryParamsVertices.put("_reserved_aai-type", "pserver");
244 queryParamsVertices.put("aai-node-type", "pserver");
246 Map<String, String> queryParamsVerticesV13 = new HashMap<>();
247 queryParamsVerticesV13.put("_reserved_version", "v13");
248 queryParamsVerticesV13.put("hostname", "myhost");
249 queryParamsVerticesV13.put("_reserved_aai-type", "pserver");
250 queryParamsVerticesV13.put("aai-node-type", "pserver");
252 Map<String, String> queryParamsEdge = new HashMap<>();
253 queryParamsEdge.put("_reserved_version", "v11");
254 queryParamsEdge.put("hostname", "myhost");
255 queryParamsEdge.put("_reserved_aai-type", "tosca.relationships.HostedOn");
257 Map<String, String> emptyQueryParams = null;
259 mockOpenTransaction();
260 mockRollbackTransaction("");
261 mockTransactionExists("");
262 mockCommitTransaction("");
263 mockGetVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertex, "pserver");
264 mockGetVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertexV13, "pserver");
265 mockGetVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "", "vserver");
266 mockGetVertex("1d326bc7-b985-492b-9604-0d5d1f06f908", "", "pserver");
267 mockGetVertex("1d326bc7-b985-492b-9604-0d5d1f06f908", "?transactionId=", "pserver");
268 mockGetVertex("test-uuid", "", "pserver");
269 mockGetVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "?transactionId=", "vserver");
270 mockGetVertices(queryParamsVertices, "pserver");
271 mockGetVertices(queryParamsVerticesV13, "pserver");
272 mockGetVertexEdges("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertex, null, "tosca.relationships.HostedOn");
273 mockGetVertexEdges("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertexV13, null,
274 "tosca.relationships.HostedOn");
275 mockGetVertexEdges("50bdab41-ad1c-4d00-952c-a0aa5d827811", emptyQueryParams, null, "tosca.relationships.HostedOn");
276 mockGetVertexEdges("1d326bc7-b985-492b-9604-0d5d1f06f908", emptyQueryParams, null, "tosca.relationships.HostedOn");
277 mockGetVertexEdges("50bdab41-ad1c-4d00-952c-a0aa5d827811", emptyQueryParams, "?transactionId=", "tosca.relationships.HostedOn");
278 mockGetVertexEdges("1d326bc7-b985-492b-9604-0d5d1f06f908", emptyQueryParams, "?transactionId=", "tosca.relationships.HostedOn");
279 mockGetEdges("?", "tosca.relationships.HostedOn");
280 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "?transactionId=", "tosca.relationships.HostedOn");
281 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", emptyQueryParams, "tosca.relationships.HostedOn");
282 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsEdge, "tosca.relationships.HostedOn");
283 mockGetEdge("my-uuid", emptyQueryParams, "tosca.relationships.HostedOn");
284 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", queryParamsEdge, "tosca.relationships.HostedOn");
285 mockPostEdge("tosca.relationships.HostedOn", "", edgePayload);
286 mockPostEdge("tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPost);
287 mockPostVertex("pserver", vertexPayload, "");
288 mockPostVertex("vserver", vertexPayloadForVserver, "?transactionId=");
289 mockPutVertex("test-uuid", "pserver", vertexPayloadForPut, "");
290 mockPutVertex("test-uuid", "pserver", vertexPayloadForPatch, "");
291 mockPutVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", vertexPayloadForPserver, "?transactionId=");
292 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPut);
293 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPatch);
294 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPutNoProperties);
295 mockDeleteVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", "pserver", "");
296 mockDeleteVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", "?transactionId=");
297 mockDeleteEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", "tosca.relationships.HostedOn", "");
298 mockDeleteEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "tosca.relationships.HostedOn", "?transactionId=");
301 public void buildChampDao() {
302 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL;
303 String baseTransactionUrl = CHAMP_URL + TRANSACTION_SUB_URL;
304 champDao = new ChampDao(restClientMock, BASE_OBJECT_URL, baseRelationshipUrl, baseTransactionUrl);
307 public void mockOpenTransaction() {
308 OperationResult operationResult = new OperationResult();
309 operationResult.setResult("");
310 operationResult.setResultCode(200);
311 String url = CHAMP_URL + "transaction";
314 when(restClientMock.post(url, "", createHeaders(), MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_PLAIN_TYPE))
315 .thenReturn(operationResult);
318 public void mockRollbackTransaction(String id) {
319 OperationResult operationResult = new OperationResult();
320 operationResult.setResult("");
321 operationResult.setResultCode(200);
322 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
325 when(restClientMock.put(url, "{\"method\": \"rollback\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
326 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
329 public void mockCommitTransaction(String id) {
330 OperationResult operationResult = new OperationResult();
331 operationResult.setResult("");
332 operationResult.setResultCode(200);
333 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
336 when(restClientMock.put(url, "{\"method\": \"commit\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
337 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
340 public void mockTransactionExists(String id) {
341 OperationResult operationResult = new OperationResult();
342 operationResult.setResult("");
343 operationResult.setResultCode(200);
344 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
346 Map<String, List<String>> headers = new HashMap<>();
347 headers.put(HEADER_FROM_APP, Arrays.asList(FROM_APP_NAME));
348 headers.put(HEADER_TRANS_ID, Arrays.asList(MDC.get(LoggingContext.LoggingField.REQUEST_ID.toString())));
350 when(restClientMock.get(url, headers, MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
353 public void mockGetVertex(String id, String txId, String type) {
354 String vertexResponse = champVertex.replace("vertexType", type);
355 OperationResult operationResult = new OperationResult();
356 operationResult.setResult(vertexResponse);
357 operationResult.setResultCode(200);
359 String url = BASE_OBJECT_URL + "/" + id + txId;
362 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
365 public void mockGetVertex(String id, Map<String, String> queryParams, String type) {
366 String vertexResponse = champVertex.replace("vertexType", type);
367 OperationResult operationResult = new OperationResult();
368 operationResult.setResult(vertexResponse);
369 operationResult.setResultCode(200);
371 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + id, queryParams);
373 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
374 .thenReturn(operationResult);
377 public void mockGetVertexEdges(String id, Map<String, String> queryParams, String txId, String type) {
378 String edgeResponse = champEdge.replace("edgeType", type);
379 OperationResult operationResult = new OperationResult();
380 List<String> edgeResponselist = new ArrayList<>();
381 edgeResponselist.add(edgeResponse);
382 operationResult.setResult(edgeResponselist.toString());
383 operationResult.setResultCode(200);
384 String baseUrl = BASE_OBJECT_URL + "/" + RELATIONSHIP_SUB_URL + "/" + id;
388 url = baseUrl + txId;
391 url = appendQueryParams(baseUrl, queryParams).toString();
394 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE))
395 .thenReturn(operationResult);
398 public void mockGetVertices(Map<String, String> queryParams, String type) {
399 String vertexResponse = champVertex.replace("vertexType", type);
400 OperationResult operationResult = new OperationResult();
401 List<String> vertexResponselist = new ArrayList<>();
402 vertexResponselist.add(vertexResponse);
403 operationResult.setResult(vertexResponselist.toString());
404 operationResult.setResultCode(200);
406 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + "filter", queryParams);
408 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
409 .thenReturn(operationResult);
412 public void mockGetEdges(String queryParams, String type) {
413 String edgeResponse = champEdge.replace("edgeType", type);
414 OperationResult operationResult = new OperationResult();
415 List<String> edgeResponselist = new ArrayList<>();
416 edgeResponselist.add(edgeResponse);
417 operationResult.setResult(edgeResponselist.toString());
418 operationResult.setResultCode(200);
420 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + "filter" + queryParams;
423 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
426 public void mockGetEdge(String id, String txId, String type) {
427 String edgeResponse = champEdge.replace("edgeType", type);
428 OperationResult operationResult = new OperationResult();
429 operationResult.setResult(edgeResponse);
430 operationResult.setResultCode(200);
432 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
434 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
437 public void mockGetEdge(String id, Map<String, String> queryParams, String type) {
438 String edgeResponse = champEdge.replace("edgeType", type);
439 OperationResult operationResult = new OperationResult();
440 operationResult.setResult(edgeResponse);
441 operationResult.setResultCode(200);
443 StringBuilder url = appendQueryParams(CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id, queryParams);
445 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
446 .thenReturn(operationResult);
449 public void mockPostEdge(String type, String txId, String payload) {
450 String edgeResponse = champEdge.replace("edgeType", type);
451 OperationResult operationResult = new OperationResult();
452 operationResult.setResult(edgeResponse);
453 operationResult.setResultCode(201);
454 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
455 headers.add("etag", "test123");
456 operationResult.setHeaders(headers);
458 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL + txId;
459 String url = baseRelationshipUrl;
462 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
463 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
466 public void mockPostVertex(String type, String payload, String txId) {
467 String vertexResponse = champVertex.replace("vertexType", type);
468 OperationResult operationResult = new OperationResult();
469 operationResult.setResult(vertexResponse);
470 operationResult.setResultCode(201);
471 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
472 headers.add("etag", "test123");
473 operationResult.setHeaders(headers);
475 String url = BASE_OBJECT_URL + txId;
478 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
479 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
482 public void mockPutVertex(String id, String type, String payload, String txId) {
483 String vertexResponse = champVertex.replace("vertexType", type);
484 OperationResult operationResult = new OperationResult();
485 operationResult.setResult(vertexResponse);
486 operationResult.setResultCode(200);
487 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
488 headers.add("etag", "test123");
489 operationResult.setHeaders(headers);
491 String url = BASE_OBJECT_URL + "/" + id + txId;
494 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
495 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
498 public void mockPutEdge(String id, String type, String txId, String payload) {
499 String edgeResponse = champEdge.replace("edgeType", type);
500 OperationResult operationResult = new OperationResult();
501 operationResult.setResult(edgeResponse);
502 operationResult.setResultCode(200);
503 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
504 headers.add("etag", "test123");
505 operationResult.setHeaders(headers);
507 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
510 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
511 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
514 public void mockDeleteVertex(String id, String type, String txId) {
515 String vertexResponse = champVertex.replace("vertexType", type);
516 OperationResult operationResult = new OperationResult();
517 operationResult.setResult(vertexResponse);
518 operationResult.setResultCode(200);
520 String url = BASE_OBJECT_URL + "/" + id + txId;
523 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
526 public void mockDeleteEdge(String id, String type, String txId) {
527 String edgeResponse = champEdge.replace("edgeType", type);
528 OperationResult operationResult = new OperationResult();
529 operationResult.setResult(edgeResponse);
530 operationResult.setResultCode(200);
532 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
535 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
538 private Map<String, List<String>> createHeaders() {
539 Map<String, List<String>> headers = new HashMap<>();
540 List<String> listFromApp = new ArrayList<>();
541 List<String> listTransId = new ArrayList<>();
542 listFromApp.add(FROM_APP_NAME);
543 listTransId.add(HEADER_TRANS_ID_VALUE);
544 headers.put(HEADER_FROM_APP, listFromApp);
545 headers.put(HEADER_TRANS_ID, listTransId);
550 private StringBuilder appendQueryParams(String url, Map<String, String> queryParams) {
551 StringBuilder strBuilder = new StringBuilder(url);
553 if (queryParams != null) {
555 for (Map.Entry<String, String> entry : queryParams.entrySet()) {
556 strBuilder.append(prefix);
558 strBuilder.append(entry.getKey() + "=" + entry.getValue());
564 public ChampDao getChampDao() {
568 public void setChampDao(ChampDao champDao) {
569 this.champDao = champDao;