|
41 | 41 | import static org.junit.Assert.assertEquals;
|
42 | 42 | import static org.junit.Assert.assertNotNull;
|
43 | 43 | import static org.junit.Assert.assertNull;
|
| 44 | +import static org.junit.Assert.assertTrue; |
44 | 45 | import static org.mockito.Mockito.spy;
|
45 | 46 | import static org.mockito.Mockito.times;
|
46 | 47 | import static org.mockito.Mockito.verify;
|
@@ -493,14 +494,15 @@ public void testGetUrlResponseCreatesValidUrlWithExtraParamsUsingGET() {
|
493 | 494 | responseStatus.setDisplayValue(ResponseErrorStatus.malformed_url.name());
|
494 | 495 | Mockito.doReturn(new Response<>(responseStatus, null))
|
495 | 496 | .when(httpAgent).fetch(stringArgumentCaptor.capture());
|
496 |
| - |
| 497 | + String removeParamKey = "some-other-param-to-remove"; |
497 | 498 | BaseSyncIntentService.RequestParamsBuilder builder = new BaseSyncIntentService.RequestParamsBuilder().configureSyncFilter("locationId", "location-1")
|
498 |
| - .addServerVersion(0).addEventPullLimit(250).addParam("region", "au-west").addParam("is_enabled", true).addParam("some-other-param", 85l); |
| 499 | + .addServerVersion(0).addEventPullLimit(250).addParam("region", "au-west").addParam("is_enabled", true).addParam("some-other-param", 85l) |
| 500 | + .addParam(removeParamKey, 745).removeParam(removeParamKey); |
499 | 501 | syncIntentService.getUrlResponse("https://sample-stage.smartregister.org/opensrp/rest/event/sync", builder, syncConfiguration, false);
|
500 | 502 |
|
501 | 503 | String syncUrl = stringArgumentCaptor.getValue();
|
502 | 504 | assertEquals("https://sample-stage.smartregister.org/opensrp/rest/event/sync?locationId=location-1&serverVersion=0&limit=250®ion=au-west&is_enabled=true&some-other-param=85", syncUrl);
|
503 |
| - |
| 505 | + assertTrue(syncIntentService.isEmptyToAdd()); |
504 | 506 | }
|
505 | 507 |
|
506 | 508 | @Test
|
|
0 commit comments