From 4a37e34616ab9f2fda8e9f8b4780a058d553473f Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Wed, 2 Dec 2020 20:53:01 +0300 Subject: [PATCH] skip enycption migration to speed tests --- .../org/smartregister/reveal/BaseUnitTest.java | 3 ++- .../reveal/TestRevealApplication.java | 8 ++------ .../reveal/shadow/CoreLibraryShadow.java | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 opensrp-reveal/src/test/java/org/smartregister/reveal/shadow/CoreLibraryShadow.java diff --git a/opensrp-reveal/src/test/java/org/smartregister/reveal/BaseUnitTest.java b/opensrp-reveal/src/test/java/org/smartregister/reveal/BaseUnitTest.java index 8e468e314e..1e0e9a7352 100644 --- a/opensrp-reveal/src/test/java/org/smartregister/reveal/BaseUnitTest.java +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/BaseUnitTest.java @@ -15,6 +15,7 @@ import org.robolectric.annotation.Config; import org.smartregister.reveal.shadow.AsyncTaskShadow; import org.smartregister.reveal.shadow.CloudantDataHandlerShadowUtils; +import org.smartregister.reveal.shadow.CoreLibraryShadow; import org.smartregister.reveal.shadow.CustomFontTextViewShadow; import org.smartregister.reveal.shadow.GeoJsonSourceShadow; import org.smartregister.reveal.shadow.KujakuMapViewShadow; @@ -33,7 +34,7 @@ MapViewShadow.class, KujakuMapViewShadow.class, RevealMapViewShadow.class, LayerShadow.class, SymbolLayerShadow.class, LineLayerShadow.class, GeoJsonSourceShadow.class, SourceShadow.class, OfflineManagerShadow.class, - AsyncTaskShadow.class, CloudantDataHandlerShadowUtils.class}, sdk = Build.VERSION_CODES.P) + AsyncTaskShadow.class, CloudantDataHandlerShadowUtils.class, CoreLibraryShadow.class}, sdk = Build.VERSION_CODES.P) public abstract class BaseUnitTest { @Rule 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 323cd4abdd..315a704395 100644 --- a/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java @@ -7,21 +7,18 @@ 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; @@ -33,9 +30,8 @@ public void onCreate() { mInstance = this; context = Context.getInstance(); context.updateApplicationContext(getApplicationContext()); - SyncConfiguration syncConfiguration = spy(new RevealSyncConfiguration()); - when(syncConfiguration.runPlanEvaluationOnClientProcessing()).thenReturn(false); - CoreLibrary.init(context, syncConfiguration); + + CoreLibrary.init(context); ConfigurableViewsLibrary.init(context); FamilyLibrary.init(context, getMetadata(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); diff --git a/opensrp-reveal/src/test/java/org/smartregister/reveal/shadow/CoreLibraryShadow.java b/opensrp-reveal/src/test/java/org/smartregister/reveal/shadow/CoreLibraryShadow.java new file mode 100644 index 0000000000..9428518d49 --- /dev/null +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/shadow/CoreLibraryShadow.java @@ -0,0 +1,17 @@ +package org.smartregister.reveal.shadow; + +import org.robolectric.annotation.Implementation; +import org.robolectric.annotation.Implements; +import org.smartregister.CoreLibrary; + +/** + * Created by samuelgithengi on 12/2/20. + */ +@Implements(CoreLibrary.class) +public class CoreLibraryShadow { + + @Implementation + private static void checkPlatformMigrations() { + //do nothing + } +}