Skip to content

Commit

Permalink
skip enycption migration to speed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
githengi committed Dec 2, 2020
1 parent ffa31d5 commit 4a37e34
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 4a37e34

Please sign in to comment.