summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-23 13:07:02 +0100
committercyBerta <cyberta@riseup.net>2021-11-23 13:07:02 +0100
commit438b2b866b64f63dc1346ca89cf3e56847def6da (patch)
tree8895bde1b0202d7b27ee8168422c8b37ae7e234f /app
parent9317eea480bce1442ad91600917730559b94753d (diff)
tweak mocking of ConfigHelper
Diffstat (limited to 'app')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/testutils/MockHelper.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/test/java/se/leap/bitmaskclient/testutils/MockHelper.java b/app/src/test/java/se/leap/bitmaskclient/testutils/MockHelper.java
index 0086e4c2..dd3053df 100644
--- a/app/src/test/java/se/leap/bitmaskclient/testutils/MockHelper.java
+++ b/app/src/test/java/se/leap/bitmaskclient/testutils/MockHelper.java
@@ -38,6 +38,7 @@ import java.util.Vector;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
+import okhttp3.Connection;
import okhttp3.OkHttpClient;
import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.base.models.Provider;
@@ -409,12 +410,13 @@ public class MockHelper {
}
public static void mockConfigHelper(String mockedFingerprint) throws CertificateEncodingException, NoSuchAlgorithmException {
- // FIXME use MockSharedPreferences instead of provider
mockStatic(ConfigHelper.class);
when(ConfigHelper.getFingerprintFromCertificate(any(X509Certificate.class), anyString())).thenReturn(mockedFingerprint);
when(ConfigHelper.checkErroneousDownload(anyString())).thenCallRealMethod();
when(ConfigHelper.parseX509CertificateFromString(anyString())).thenCallRealMethod();
when(ConfigHelper.getProviderFormattedString(any(Resources.class), anyInt())).thenCallRealMethod();
+ when(ConfigHelper.timezoneDistance(anyInt(), anyInt())).thenCallRealMethod();
+ when(ConfigHelper.isIPv4(anyString())).thenCallRealMethod();
}
public static void mockPreferenceHelper(final Provider providerFromPrefs) {