From 83ca260052d16892b9476566b482616112be308f 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 | 5 ++--- .../reveal/shadow/CoreLibraryShadow.java | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 4 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..083ed97332 100644 --- a/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java +++ b/opensrp-reveal/src/test/java/org/smartregister/reveal/TestRevealApplication.java @@ -33,9 +33,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 + } +}