From 949c667a47dd282840ee39df810bd105054e0cd6 Mon Sep 17 00:00:00 2001 From: vend Date: Mon, 29 May 2023 19:04:44 +0500 Subject: [PATCH] updated test --- .../org/smartregister/service/DrishtiServiceTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/opensrp-core/src/test/java/org/smartregister/service/DrishtiServiceTest.java b/opensrp-core/src/test/java/org/smartregister/service/DrishtiServiceTest.java index 2668e82cc..c5380f2e5 100644 --- a/opensrp-core/src/test/java/org/smartregister/service/DrishtiServiceTest.java +++ b/opensrp-core/src/test/java/org/smartregister/service/DrishtiServiceTest.java @@ -14,7 +14,6 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; import org.smartregister.BaseUnitTest; import org.smartregister.domain.Response; import org.smartregister.domain.ResponseStatus; @@ -24,6 +23,8 @@ import java.util.Arrays; import java.util.List; +import static org.junit.Assert.assertTrue; + public class DrishtiServiceTest extends BaseUnitTest { @Mock private HTTPAgent httpAgent; @@ -69,7 +70,7 @@ public void shouldFetchNoAlertActionsWhenJsonIsForEmptyList() throws Exception { Response> actions = drishtiService.fetchNewActions("anm1", "0"); - Assert.assertTrue(actions.payload().isEmpty()); + assertTrue(actions.payload().isEmpty()); } @Test @@ -78,7 +79,7 @@ public void shouldFetchNoAlertActionsWhenHTTPCallFails() throws Exception { Response> actions = drishtiService.fetchNewActions("anm1", "0"); - Assert.assertTrue(actions.payload().isEmpty()); + assertTrue(actions.payload().isEmpty()); Assert.assertEquals(ResponseStatus.failure, actions.status()); } @@ -102,7 +103,7 @@ public void shouldReturnFailureResponseWhenJsonIsMalformed() { Response> actions = drishtiService.fetchNewActions("anm1", "0"); - Assert.assertTrue(actions.payload().isEmpty()); + assertTrue(actions.payload().isEmpty()); Assert.assertEquals(ResponseStatus.failure, actions.status()); } @@ -116,5 +117,6 @@ public void testStartOnlyIfConnectedToNetwork() { .thenReturn(connectivityManager); Mockito.when(connectivityManager.getActiveNetworkInfo()).thenReturn(networkInfo); DrishtiSyncScheduler.startOnlyIfConnectedToNetwork(context); + assertTrue(networkInfo.isConnected()); } }