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;
26 import java.util.ArrayList;
27 import java.util.Arrays;
28 import java.util.HashMap;
29 import java.util.List;
31 import javax.ws.rs.core.MediaType;
32 import javax.ws.rs.core.MultivaluedHashMap;
33 import javax.ws.rs.core.MultivaluedMap;
34 import org.onap.aai.restclient.client.OperationResult;
35 import org.onap.aai.restclient.client.RestClient;
36 import org.onap.crud.dao.champ.ChampDao;
38 public class ChampDaoMockTest {
40 private final String champVertex = "{" +
41 "\"key\": \"test-uuid\"," +
42 "\"type\": \"vertexType\"," +
44 "\"fqdn\": \"myhost.onap.com\"," +
45 "\"hostname\": \"myhost\" } }";
47 private final String champEdge = "{" +
48 "\"key\": \"test-uuid\"," +
49 "\"type\": \"edgeType\"," +
51 "\"prevent-delete\": \"NONE\" }," +
53 "\"key\": \"50bdab41-ad1c-4d00-952c-a0aa5d827811\", \"type\": \"vserver\"}," +
55 "\"key\": \"1d326bc7-b985-492b-9604-0d5d1f06f908\", \"type\": \"pserver\"}" +
58 private final String edgePayload = "{" +
59 "\"type\":\"tosca.relationships.HostedOn\"," +
61 "\"prevent-delete\":\"NONE\"}," +
63 "\"key\":\"test-uuid\"," +
64 "\"type\":\"vserver\"," +
65 "\"properties\":{}}," +
67 "\"key\":\"test-uuid\"," +
68 "\"type\":\"pserver\"," +
70 "\"hostname\":\"myhost\"," +
71 "\"fqdn\":\"myhost.onap.com\"}}}";
73 private final String edgePayloadForPut = "{" +
74 "\"key\":\"test-uuid\"," +
75 "\"type\":\"tosca.relationships.HostedOn\"," +
77 "\"prevent-delete\":\"NONE\"}," +
79 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
80 "\"type\":\"vserver\"," +
81 "\"properties\":{}}," +
83 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
84 "\"type\":\"pserver\"," +
85 "\"properties\":{}}}";
87 private final String edgePayloadForPatch = "{" +
88 "\"key\":\"test-uuid\"," +
89 "\"type\":\"tosca.relationships.HostedOn\"," +
91 "\"prevent-delete\":\"NONE\"}," +
93 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
94 "\"type\":\"vserver\"}," +
96 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
97 "\"type\":\"pserver\"}}";
99 private final String edgePayloadForPost = "{" +
100 "\"type\":\"tosca.relationships.HostedOn\"," +
102 "\"SVC-INFRA\":\"OUT\"," +
103 "\"prevent-delete\":\"IN\"," +
104 "\"delete-other-v\":\"NONE\"," +
105 "\"contains-other-v\":\"NONE\"" +
108 "\"key\":\"test-uuid\"," +
109 "\"type\":\"vserver\"," +
115 "\"key\":\"test-uuid\"," +
116 "\"type\":\"pserver\"," +
118 "\"hostname\":\"myhost\"," +
119 "\"fqdn\":\"myhost.onap.com\"" +
124 private final String edgePayloadForPutNoProperties = "{" +
125 "\"key\":\"test-uuid\"," +
126 "\"type\":\"tosca.relationships.HostedOn\"," +
128 "\"SVC-INFRA\":\"OUT\"," +
129 "\"prevent-delete\":\"IN\"," +
130 "\"delete-other-v\":\"NONE\"," +
131 "\"contains-other-v\":\"NONE\"" +
134 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
135 "\"type\":\"vserver\"," +
141 "\"key\":\"1d326bc7-b985-492b-9604-0d5d1f06f908\"," +
142 "\"type\":\"pserver\"," +
149 private final String vertexPayload = "{" +
150 "\"type\":\"pserver\"," +
152 "\"hostname\":\"myhost\"," +
153 "\"in-maint\":false," +
154 "\"fqdn\":\"myhost.onap.com\"," +
155 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
156 "\"source-of-truth\":\"source-of-truth\"," +
157 "\"aai-node-type\":\"pserver\"}}";
159 private final String vertexPayloadForVserver = "{" +
160 "\"type\":\"vserver\"," +
162 "\"in-maint\":false," +
163 "\"vserver-name\":\"test-vserver\"," +
164 "\"vserver-id\":\"VSER1\"," +
165 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
166 "\"vserver-name2\":\"alt-test-vserver\"," +
167 "\"source-of-truth\":\"source-of-truth\"," +
168 "\"vserver-selflink\":\"http://1.2.3.4/moreInfo\"," +
169 "\"is-closed-loop-disabled\":false," +
170 "\"aai-node-type\":\"vserver\"}}";
172 private final String vertexPayloadForPserver = "{" +
173 "\"key\":\"50bdab41-ad1c-4d00-952c-a0aa5d827811\"," +
174 "\"type\":\"pserver\"," +
176 "\"ptnii-equip-name\":\"e-name\"," +
177 "\"hostname\":\"steve-host2\"," +
178 "\"equip-type\":\"server\"," +
179 "\"equip-vendor\":\"HP\"," +
180 "\"equip-model\":\"DL380p-nd\"," +
181 "\"in-maint\":false," +
182 "\"fqdn\":\"myhost.onap.net\"," +
183 "\"purpose\":\"my-purpose\"," +
184 "\"ipv4-oam-address\":\"1.2.3.4\"," +
185 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
186 "\"aai-node-type\":\"pserver\"}}";
188 private final String vertexPayloadForPut = "{" +
189 "\"key\":\"test-uuid\"," +
190 "\"type\":\"pserver\"," +
192 "\"hostname\":\"myhost\"," +
193 "\"in-maint\":false," +
194 "\"fqdn\":\"myhost.onap.com\"," +
195 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
196 "\"aai-node-type\":\"pserver\"}}";
198 private final String vertexPayloadForPatch = "{" +
199 "\"key\":\"test-uuid\"," +
200 "\"type\":\"pserver\"," +
202 "\"hostname\":\"myhost\"," +
203 "\"fqdn\":\"myhost.onap.com\"," +
204 "\"last-mod-source-of-truth\":\"source-of-truth\"," +
205 "\"aai-node-type\":\"pserver\"}}";
208 private RestClient restClientMock;
209 private ChampDao champDao;
211 static final String CHAMP_URL = "https://host:9522/services/champ-service/v1/";
212 static final String OBJECT_SUB_URL = "objects";
213 static final String RELATIONSHIP_SUB_URL = "relationships";
214 static final String TRANSACTION_SUB_URL = "transaction";
215 static final String BASE_OBJECT_URL = CHAMP_URL + OBJECT_SUB_URL;
216 static final String HEADER_FROM_APP = "X-FromAppId";
217 static final String HEADER_TRANS_ID = "X-TransactionId";
218 static final String FROM_APP_NAME = "Gizmo";
219 static final String HEADER_TRANS_ID_VALUE = "1234567890";
222 restClientMock = mock(RestClient.class);
229 Map<String, String> queryParamsVertex = new HashMap<>();
230 queryParamsVertex.put("_reserved_version", "v11");
231 queryParamsVertex.put("hostname", "myhost");
232 queryParamsVertex.put("_reserved_aai-type", "pserver");
234 Map<String, String> queryParamsVertexV13 = new HashMap<>();
235 queryParamsVertexV13.put("_reserved_version", "v13");
236 queryParamsVertexV13.put("hostname", "myhost");
237 queryParamsVertexV13.put("_reserved_aai-type", "pserver");
239 Map<String, String> queryParamsVertices = new HashMap<>();
240 queryParamsVertices.put("_reserved_version", "v11");
241 queryParamsVertices.put("hostname", "myhost");
242 queryParamsVertices.put("_reserved_aai-type", "pserver");
243 queryParamsVertices.put("aai-node-type", "pserver");
245 Map<String, String> queryParamsVerticesV13 = new HashMap<>();
246 queryParamsVerticesV13.put("_reserved_version", "v13");
247 queryParamsVerticesV13.put("hostname", "myhost");
248 queryParamsVerticesV13.put("_reserved_aai-type", "pserver");
249 queryParamsVerticesV13.put("aai-node-type", "pserver");
251 Map<String, String> queryParamsEdge = new HashMap<>();
252 queryParamsEdge.put("_reserved_version", "v11");
253 queryParamsEdge.put("hostname", "myhost");
254 queryParamsEdge.put("_reserved_aai-type", "tosca.relationships.HostedOn");
256 Map<String, String> emptyQueryParams = null;
258 mockOpenTransaction();
259 mockRollbackTransaction("");
260 mockTransactionExists("");
261 mockCommitTransaction("");
262 mockGetVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertex, "pserver");
263 mockGetVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertexV13, "pserver");
264 mockGetVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "", "vserver");
265 mockGetVertex("1d326bc7-b985-492b-9604-0d5d1f06f908", "", "pserver");
266 mockGetVertex("1d326bc7-b985-492b-9604-0d5d1f06f908", "?transactionId=", "pserver");
267 mockGetVertex("test-uuid", "", "pserver");
268 mockGetVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "?transactionId=", "vserver");
269 mockGetVertices(queryParamsVertices, "pserver");
270 mockGetVertices(queryParamsVerticesV13, "pserver");
271 mockGetVertexEdges("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertex, null, "tosca.relationships.HostedOn");
272 mockGetVertexEdges("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertexV13, null,
273 "tosca.relationships.HostedOn");
274 mockGetVertexEdges("50bdab41-ad1c-4d00-952c-a0aa5d827811", emptyQueryParams, null, "tosca.relationships.HostedOn");
275 mockGetVertexEdges("1d326bc7-b985-492b-9604-0d5d1f06f908", emptyQueryParams, null, "tosca.relationships.HostedOn");
276 mockGetVertexEdges("50bdab41-ad1c-4d00-952c-a0aa5d827811", emptyQueryParams, "?transactionId=", "tosca.relationships.HostedOn");
277 mockGetVertexEdges("1d326bc7-b985-492b-9604-0d5d1f06f908", emptyQueryParams, "?transactionId=", "tosca.relationships.HostedOn");
278 mockGetEdges("?", "tosca.relationships.HostedOn");
279 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "?transactionId=", "tosca.relationships.HostedOn");
280 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", emptyQueryParams, "tosca.relationships.HostedOn");
281 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsEdge, "tosca.relationships.HostedOn");
282 mockGetEdge("my-uuid", emptyQueryParams, "tosca.relationships.HostedOn");
283 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", queryParamsEdge, "tosca.relationships.HostedOn");
284 mockPostEdge("tosca.relationships.HostedOn", "", edgePayload);
285 mockPostEdge("tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPost);
286 mockPostVertex("pserver", vertexPayload, "");
287 mockPostVertex("vserver", vertexPayloadForVserver, "?transactionId=");
288 mockPutVertex("test-uuid", "pserver", vertexPayloadForPut, "");
289 mockPutVertex("test-uuid", "pserver", vertexPayloadForPatch, "");
290 mockPutVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", vertexPayloadForPserver, "?transactionId=");
291 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPut);
292 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPatch);
293 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPutNoProperties);
294 mockDeleteVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", "pserver", "");
295 mockDeleteVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", "?transactionId=");
296 mockDeleteEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", "tosca.relationships.HostedOn", "");
297 mockDeleteEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "tosca.relationships.HostedOn", "?transactionId=");
300 public void buildChampDao() {
301 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL;
302 String baseTransactionUrl = CHAMP_URL + TRANSACTION_SUB_URL;
303 champDao = new ChampDao(restClientMock, BASE_OBJECT_URL, baseRelationshipUrl, baseTransactionUrl);
306 public void mockOpenTransaction() {
307 OperationResult operationResult = new OperationResult();
308 operationResult.setResult("");
309 operationResult.setResultCode(200);
310 String url = CHAMP_URL + "transaction";
313 when(restClientMock.post(url, "", createHeaders(), MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_PLAIN_TYPE))
314 .thenReturn(operationResult);
317 public void mockRollbackTransaction(String id) {
318 OperationResult operationResult = new OperationResult();
319 operationResult.setResult("");
320 operationResult.setResultCode(200);
321 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
324 when(restClientMock.put(url, "{\"method\": \"rollback\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
325 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
328 public void mockCommitTransaction(String id) {
329 OperationResult operationResult = new OperationResult();
330 operationResult.setResult("");
331 operationResult.setResultCode(200);
332 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
335 when(restClientMock.put(url, "{\"method\": \"commit\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
336 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
339 public void mockTransactionExists(String id) {
340 OperationResult operationResult = new OperationResult();
341 operationResult.setResult("");
342 operationResult.setResultCode(200);
343 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
345 Map<String, List<String>> headers = new HashMap<>();
346 headers.put(HEADER_FROM_APP, Arrays.asList(FROM_APP_NAME));
347 headers.put(HEADER_TRANS_ID, Arrays.asList(HEADER_TRANS_ID_VALUE));
349 when(restClientMock.get(url, headers, MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
352 public void mockGetVertex(String id, String txId, String type) {
353 String vertexResponse = champVertex.replace("vertexType", type);
354 OperationResult operationResult = new OperationResult();
355 operationResult.setResult(vertexResponse);
356 operationResult.setResultCode(200);
358 String url = BASE_OBJECT_URL + "/" + id + txId;
361 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
364 public void mockGetVertex(String id, Map<String, String> queryParams, String type) {
365 String vertexResponse = champVertex.replace("vertexType", type);
366 OperationResult operationResult = new OperationResult();
367 operationResult.setResult(vertexResponse);
368 operationResult.setResultCode(200);
370 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + id, queryParams);
372 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
373 .thenReturn(operationResult);
376 public void mockGetVertexEdges(String id, Map<String, String> queryParams, String txId, String type) {
377 String edgeResponse = champEdge.replace("edgeType", type);
378 OperationResult operationResult = new OperationResult();
379 List<String> edgeResponselist = new ArrayList<>();
380 edgeResponselist.add(edgeResponse);
381 operationResult.setResult(edgeResponselist.toString());
382 operationResult.setResultCode(200);
383 String baseUrl = BASE_OBJECT_URL + "/" + RELATIONSHIP_SUB_URL + "/" + id;
387 url = baseUrl + txId;
390 url = appendQueryParams(baseUrl, queryParams).toString();
393 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE))
394 .thenReturn(operationResult);
397 public void mockGetVertices(Map<String, String> queryParams, String type) {
398 String vertexResponse = champVertex.replace("vertexType", type);
399 OperationResult operationResult = new OperationResult();
400 List<String> vertexResponselist = new ArrayList<>();
401 vertexResponselist.add(vertexResponse);
402 operationResult.setResult(vertexResponselist.toString());
403 operationResult.setResultCode(200);
405 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + "filter", queryParams);
407 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
408 .thenReturn(operationResult);
411 public void mockGetEdges(String queryParams, String type) {
412 String edgeResponse = champEdge.replace("edgeType", type);
413 OperationResult operationResult = new OperationResult();
414 List<String> edgeResponselist = new ArrayList<>();
415 edgeResponselist.add(edgeResponse);
416 operationResult.setResult(edgeResponselist.toString());
417 operationResult.setResultCode(200);
419 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + "filter" + queryParams;
422 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
425 public void mockGetEdge(String id, String txId, String type) {
426 String edgeResponse = champEdge.replace("edgeType", type);
427 OperationResult operationResult = new OperationResult();
428 operationResult.setResult(edgeResponse);
429 operationResult.setResultCode(200);
431 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
433 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
436 public void mockGetEdge(String id, Map<String, String> queryParams, String type) {
437 String edgeResponse = champEdge.replace("edgeType", type);
438 OperationResult operationResult = new OperationResult();
439 operationResult.setResult(edgeResponse);
440 operationResult.setResultCode(200);
442 StringBuilder url = appendQueryParams(CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id, queryParams);
444 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
445 .thenReturn(operationResult);
448 public void mockPostEdge(String type, String txId, String payload) {
449 String edgeResponse = champEdge.replace("edgeType", type);
450 OperationResult operationResult = new OperationResult();
451 operationResult.setResult(edgeResponse);
452 operationResult.setResultCode(201);
453 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
454 headers.add("etag", "test123");
455 operationResult.setHeaders(headers);
457 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL + txId;
458 String url = baseRelationshipUrl;
461 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
462 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
465 public void mockPostVertex(String type, String payload, String txId) {
466 String vertexResponse = champVertex.replace("vertexType", type);
467 OperationResult operationResult = new OperationResult();
468 operationResult.setResult(vertexResponse);
469 operationResult.setResultCode(201);
470 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
471 headers.add("etag", "test123");
472 operationResult.setHeaders(headers);
474 String url = BASE_OBJECT_URL + txId;
477 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
478 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
481 public void mockPutVertex(String id, String type, String payload, String txId) {
482 String vertexResponse = champVertex.replace("vertexType", type);
483 OperationResult operationResult = new OperationResult();
484 operationResult.setResult(vertexResponse);
485 operationResult.setResultCode(200);
486 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
487 headers.add("etag", "test123");
488 operationResult.setHeaders(headers);
490 String url = BASE_OBJECT_URL + "/" + id + txId;
493 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
494 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
497 public void mockPutEdge(String id, String type, String txId, String payload) {
498 String edgeResponse = champEdge.replace("edgeType", type);
499 OperationResult operationResult = new OperationResult();
500 operationResult.setResult(edgeResponse);
501 operationResult.setResultCode(200);
502 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
503 headers.add("etag", "test123");
504 operationResult.setHeaders(headers);
506 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
509 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
510 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
513 public void mockDeleteVertex(String id, String type, String txId) {
514 String vertexResponse = champVertex.replace("vertexType", type);
515 OperationResult operationResult = new OperationResult();
516 operationResult.setResult(vertexResponse);
517 operationResult.setResultCode(200);
519 String url = BASE_OBJECT_URL + "/" + id + txId;
522 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
525 public void mockDeleteEdge(String id, String type, String txId) {
526 String edgeResponse = champEdge.replace("edgeType", type);
527 OperationResult operationResult = new OperationResult();
528 operationResult.setResult(edgeResponse);
529 operationResult.setResultCode(200);
531 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
534 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
537 private Map<String, List<String>> createHeaders() {
538 Map<String, List<String>> headers = new HashMap<>();
539 List<String> listFromApp = new ArrayList<>();
540 List<String> listTransId = new ArrayList<>();
541 listFromApp.add(FROM_APP_NAME);
542 listTransId.add(HEADER_TRANS_ID_VALUE);
543 headers.put(HEADER_FROM_APP, listFromApp);
544 headers.put(HEADER_TRANS_ID, listTransId);
549 private StringBuilder appendQueryParams(String url, Map<String, String> queryParams) {
550 StringBuilder strBuilder = new StringBuilder(url);
552 if (queryParams != null) {
554 for (Map.Entry<String, String> entry : queryParams.entrySet()) {
555 strBuilder.append(prefix);
557 strBuilder.append(entry.getKey() + "=" + entry.getValue());
563 public ChampDao getChampDao() {
567 public void setChampDao(ChampDao champDao) {
568 this.champDao = champDao;