Skip to content

Commit

Permalink
Fix failing tests in P2PSenderTransferDao
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Aug 21, 2020
1 parent a84f4e9 commit 31e3c47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.smartregister;

import org.robolectric.util.ReflectionHelpers;
import org.smartregister.repository.AllSharedPreferences;

import javassist.tools.reflect.Reflection;

import static android.preference.PreferenceManager.getDefaultSharedPreferences;

/**
Expand All @@ -17,6 +20,7 @@ public void onCreate() {

AllSharedPreferences allSharedPreferences = new AllSharedPreferences(getDefaultSharedPreferences(context.applicationContext()));
allSharedPreferences.updateANMUserName("demo");
ReflectionHelpers.setStaticField(CoreLibrary.class, "instance", null);
CoreLibrary.init(context, null, 1588062490000l, new P2POptions(true));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/**
* Created by Ephraim Kigamba - [email protected] on 04-08-2020.
*/
@Config(application = TestP2pApplication.class)
public class P2PSenderTransferDaoTest extends BaseRobolectricUnitTest {

private P2PSenderTransferDao p2PSenderTransferDao;
Expand Down

0 comments on commit 31e3c47

Please sign in to comment.