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, "tosca.relationships.HostedOn");
273 mockGetVertexEdges("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsVertexV13,
274 "tosca.relationships.HostedOn");
275 mockGetVertexEdges("50bdab41-ad1c-4d00-952c-a0aa5d827811", emptyQueryParams, "tosca.relationships.HostedOn");
276 mockGetVertexEdges("1d326bc7-b985-492b-9604-0d5d1f06f908", emptyQueryParams, "tosca.relationships.HostedOn");
277 mockGetEdges("?", "tosca.relationships.HostedOn");
278 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "?transactionId=", "tosca.relationships.HostedOn");
279 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", emptyQueryParams, "tosca.relationships.HostedOn");
280 mockGetEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", queryParamsEdge, "tosca.relationships.HostedOn");
281 mockGetEdge("my-uuid", emptyQueryParams, "tosca.relationships.HostedOn");
282 mockGetEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", queryParamsEdge, "tosca.relationships.HostedOn");
283 mockPostEdge("tosca.relationships.HostedOn", "", edgePayload);
284 mockPostEdge("tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPost);
285 mockPostVertex("pserver", vertexPayload, "");
286 mockPostVertex("vserver", vertexPayloadForVserver, "?transactionId=");
287 mockPutVertex("test-uuid", "pserver", vertexPayloadForPut, "");
288 mockPutVertex("test-uuid", "pserver", vertexPayloadForPatch, "");
289 mockPutVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", vertexPayloadForPserver, "?transactionId=");
290 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPut);
291 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "", edgePayloadForPatch);
292 mockPutEdge("test-uuid", "tosca.relationships.HostedOn", "?transactionId=", edgePayloadForPutNoProperties);
293 mockDeleteVertex("872dd5df-0be9-4167-95e9-2cf4b21165ed", "pserver", "");
294 mockDeleteVertex("50bdab41-ad1c-4d00-952c-a0aa5d827811", "pserver", "?transactionId=");
295 mockDeleteEdge("872dd5df-0be9-4167-95e9-2cf4b21165ed", "tosca.relationships.HostedOn", "");
296 mockDeleteEdge("50bdab41-ad1c-4d00-952c-a0aa5d827811", "tosca.relationships.HostedOn", "?transactionId=");
299 public void buildChampDao() {
300 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL;
301 String baseTransactionUrl = CHAMP_URL + TRANSACTION_SUB_URL;
302 champDao = new ChampDao(restClientMock, BASE_OBJECT_URL, baseRelationshipUrl, baseTransactionUrl);
305 public void mockOpenTransaction() {
306 OperationResult operationResult = new OperationResult();
307 operationResult.setResult("");
308 operationResult.setResultCode(200);
309 String url = CHAMP_URL + "transaction";
312 when(restClientMock.post(url, "", createHeaders(), MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_PLAIN_TYPE))
313 .thenReturn(operationResult);
316 public void mockRollbackTransaction(String id) {
317 OperationResult operationResult = new OperationResult();
318 operationResult.setResult("");
319 operationResult.setResultCode(200);
320 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
323 when(restClientMock.put(url, "{\"method\": \"rollback\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
324 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
327 public void mockCommitTransaction(String id) {
328 OperationResult operationResult = new OperationResult();
329 operationResult.setResult("");
330 operationResult.setResultCode(200);
331 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
334 when(restClientMock.put(url, "{\"method\": \"commit\"}", createHeaders(), MediaType.APPLICATION_JSON_TYPE,
335 MediaType.TEXT_PLAIN_TYPE)).thenReturn(operationResult);
338 public void mockTransactionExists(String id) {
339 OperationResult operationResult = new OperationResult();
340 operationResult.setResult("");
341 operationResult.setResultCode(200);
342 String url = CHAMP_URL + TRANSACTION_SUB_URL + "/" + id;
344 Map<String, List<String>> headers = new HashMap<>();
345 headers.put(HEADER_FROM_APP, Arrays.asList(FROM_APP_NAME));
346 headers.put(HEADER_TRANS_ID, Arrays.asList(MDC.get(LoggingContext.LoggingField.REQUEST_ID.toString())));
348 when(restClientMock.get(url, headers, MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
351 public void mockGetVertex(String id, String txId, String type) {
352 String vertexResponse = champVertex.replace("vertexType", type);
353 OperationResult operationResult = new OperationResult();
354 operationResult.setResult(vertexResponse);
355 operationResult.setResultCode(200);
357 String url = BASE_OBJECT_URL + "/" + id + txId;
360 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
363 public void mockGetVertex(String id, Map<String, String> queryParams, String type) {
364 String vertexResponse = champVertex.replace("vertexType", type);
365 OperationResult operationResult = new OperationResult();
366 operationResult.setResult(vertexResponse);
367 operationResult.setResultCode(200);
369 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + id, queryParams);
371 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
372 .thenReturn(operationResult);
375 public void mockGetVertexEdges(String id, Map<String, String> queryParams, String type) {
376 String edgeResponse = champEdge.replace("edgeType", type);
377 OperationResult operationResult = new OperationResult();
378 List<String> edgeResponselist = new ArrayList<>();
379 edgeResponselist.add(edgeResponse);
380 operationResult.setResult(edgeResponselist.toString());
381 operationResult.setResultCode(200);
383 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + RELATIONSHIP_SUB_URL + "/" + id, queryParams);
385 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
386 .thenReturn(operationResult);
389 public void mockGetVertices(Map<String, String> queryParams, String type) {
390 String vertexResponse = champVertex.replace("vertexType", type);
391 OperationResult operationResult = new OperationResult();
392 List<String> vertexResponselist = new ArrayList<>();
393 vertexResponselist.add(vertexResponse);
394 operationResult.setResult(vertexResponselist.toString());
395 operationResult.setResultCode(200);
397 StringBuilder url = appendQueryParams(BASE_OBJECT_URL + "/" + "filter", queryParams);
399 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
400 .thenReturn(operationResult);
403 public void mockGetEdges(String queryParams, String type) {
404 String edgeResponse = champEdge.replace("edgeType", type);
405 OperationResult operationResult = new OperationResult();
406 List<String> edgeResponselist = new ArrayList<>();
407 edgeResponselist.add(edgeResponse);
408 operationResult.setResult(edgeResponselist.toString());
409 operationResult.setResultCode(200);
411 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + "filter" + queryParams;
414 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
417 public void mockGetEdge(String id, String txId, String type) {
418 String edgeResponse = champEdge.replace("edgeType", type);
419 OperationResult operationResult = new OperationResult();
420 operationResult.setResult(edgeResponse);
421 operationResult.setResultCode(200);
423 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
425 when(restClientMock.get(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
428 public void mockGetEdge(String id, Map<String, String> queryParams, String type) {
429 String edgeResponse = champEdge.replace("edgeType", type);
430 OperationResult operationResult = new OperationResult();
431 operationResult.setResult(edgeResponse);
432 operationResult.setResultCode(200);
434 StringBuilder url = appendQueryParams(CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id, queryParams);
436 when(restClientMock.get(url.toString(), createHeaders(), MediaType.APPLICATION_JSON_TYPE))
437 .thenReturn(operationResult);
440 public void mockPostEdge(String type, String txId, String payload) {
441 String edgeResponse = champEdge.replace("edgeType", type);
442 OperationResult operationResult = new OperationResult();
443 operationResult.setResult(edgeResponse);
444 operationResult.setResultCode(201);
445 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
446 headers.add("etag", "test123");
447 operationResult.setHeaders(headers);
449 String baseRelationshipUrl = CHAMP_URL + RELATIONSHIP_SUB_URL + txId;
450 String url = baseRelationshipUrl;
453 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
454 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
457 public void mockPostVertex(String type, String payload, String txId) {
458 String vertexResponse = champVertex.replace("vertexType", type);
459 OperationResult operationResult = new OperationResult();
460 operationResult.setResult(vertexResponse);
461 operationResult.setResultCode(201);
462 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
463 headers.add("etag", "test123");
464 operationResult.setHeaders(headers);
466 String url = BASE_OBJECT_URL + txId;
469 when(restClientMock.post(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
470 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
473 public void mockPutVertex(String id, String type, String payload, String txId) {
474 String vertexResponse = champVertex.replace("vertexType", type);
475 OperationResult operationResult = new OperationResult();
476 operationResult.setResult(vertexResponse);
477 operationResult.setResultCode(200);
478 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
479 headers.add("etag", "test123");
480 operationResult.setHeaders(headers);
482 String url = BASE_OBJECT_URL + "/" + id + txId;
485 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
486 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
489 public void mockPutEdge(String id, String type, String txId, String payload) {
490 String edgeResponse = champEdge.replace("edgeType", type);
491 OperationResult operationResult = new OperationResult();
492 operationResult.setResult(edgeResponse);
493 operationResult.setResultCode(200);
494 MultivaluedMap<String, String> headers = new MultivaluedHashMap<String, String>();
495 headers.add("etag", "test123");
496 operationResult.setHeaders(headers);
498 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
501 when(restClientMock.put(url, payload, createHeaders(), MediaType.APPLICATION_JSON_TYPE,
502 MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
505 public void mockDeleteVertex(String id, String type, String txId) {
506 String vertexResponse = champVertex.replace("vertexType", type);
507 OperationResult operationResult = new OperationResult();
508 operationResult.setResult(vertexResponse);
509 operationResult.setResultCode(200);
511 String url = BASE_OBJECT_URL + "/" + id + txId;
514 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
517 public void mockDeleteEdge(String id, String type, String txId) {
518 String edgeResponse = champEdge.replace("edgeType", type);
519 OperationResult operationResult = new OperationResult();
520 operationResult.setResult(edgeResponse);
521 operationResult.setResultCode(200);
523 String url = CHAMP_URL + RELATIONSHIP_SUB_URL + "/" + id + txId;
526 when(restClientMock.delete(url, createHeaders(), MediaType.APPLICATION_JSON_TYPE)).thenReturn(operationResult);
529 private Map<String, List<String>> createHeaders() {
530 Map<String, List<String>> headers = new HashMap<>();
531 List<String> listFromApp = new ArrayList<>();
532 List<String> listTransId = new ArrayList<>();
533 listFromApp.add(FROM_APP_NAME);
534 listTransId.add(HEADER_TRANS_ID_VALUE);
535 headers.put(HEADER_FROM_APP, listFromApp);
536 headers.put(HEADER_TRANS_ID, listTransId);
541 private StringBuilder appendQueryParams(String url, Map<String, String> queryParams) {
542 StringBuilder strBuilder = new StringBuilder(url);
544 if (queryParams != null) {
546 for (Map.Entry<String, String> entry : queryParams.entrySet()) {
547 strBuilder.append(prefix);
549 strBuilder.append(entry.getKey() + "=" + entry.getValue());
555 public ChampDao getChampDao() {
559 public void setChampDao(ChampDao champDao) {
560 this.champDao = champDao;