diff --git a/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java b/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java index 83ad39d170..323cd4abdd 100644 --- a/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java @@ -7,18 +7,21 @@ import org.smartregister.Context; import org.smartregister.CoreLibrary; +import org.smartregister.SyncConfiguration; import org.smartregister.configurableviews.ConfigurableViewsLibrary; import org.smartregister.family.FamilyLibrary; import org.smartregister.receiver.ValidateAssignmentReceiver; import org.smartregister.repository.Repository; import org.smartregister.reveal.application.RevealApplication; import org.smartregister.reveal.util.AppExecutors; +import org.smartregister.reveal.util.RevealSyncConfiguration; import java.util.concurrent.Executors; import io.ona.kujaku.data.realm.RealmDatabase; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -30,7 +33,9 @@ public void onCreate() { mInstance = this; context = Context.getInstance(); context.updateApplicationContext(getApplicationContext()); - CoreLibrary.init(context); + SyncConfiguration syncConfiguration = spy(new RevealSyncConfiguration()); + when(syncConfiguration.runPlanEvaluationOnClientProcessing()).thenReturn(false); + CoreLibrary.init(context, syncConfiguration); ConfigurableViewsLibrary.init(context); FamilyLibrary.init(context, getMetadata(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); diff --git a/opensrp-reveal/src/test/java/org/smartregister/reveal/interactor/BaseInteractorTest.java b/opensrp-reveal/src/test/java/org/smartregister/reveal/interactor/BaseInteractorTest.java index f7b6a91801..98fbba9107 100644 --- a/opensrp-reveal/src/test/java/org/smartregister/reveal/interactor/BaseInteractorTest.java +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/interactor/BaseInteractorTest.java @@ -32,7 +32,6 @@ import org.smartregister.domain.Task; import org.smartregister.domain.db.EventClient; import org.smartregister.family.util.Constants; -import org.smartregister.repository.BaseRepository; import org.smartregister.repository.EventClientRepository; import org.smartregister.repository.StructureRepository; import org.smartregister.repository.TaskRepository; @@ -169,7 +168,7 @@ public void testFetchFamilyDetails() { public void testSavePaotForm() throws JSONException { Cache cache = mock(Cache.class); when(cache.get(anyString(), any())).thenReturn(mock(Location.class)); - Whitebox.setInternalState(Utils.class, cache); + Whitebox.setInternalState(Utils.class, "cache", cache); String form = AssetHandler.readFileFromAssetsFolder(org.smartregister.reveal.util.Constants.JsonForm.PAOT_FORM, context); JSONObject formObject = new JSONObject(form); String structureId = UUID.randomUUID().toString();