summaryrefslogtreecommitdiff
path: root/app/src/sharedTest
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2020-07-23 17:41:26 +0200
committercyBerta <cyberta@riseup.net>2020-07-23 17:41:26 +0200
commit4e861a972a28bd7eb268fb03c80b989a8b36c2a0 (patch)
treed6739a92465d06430477d08a56e93f48e6a1fab8 /app/src/sharedTest
parentb92177a2d26f0f96671c848d26c79b08dca13f71 (diff)
adapt existing tests for geoipservice api
Diffstat (limited to 'app/src/sharedTest')
-rw-r--r--app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java b/app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java
index 69fffcb4..c741faf2 100644
--- a/app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java
+++ b/app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java
@@ -51,10 +51,10 @@ public class TestSetupHelper {
public static Provider getConfiguredProvider() throws IOException, JSONException {
- return getProvider(null, null, null, null, null, null, null);
+ return getProvider(null, null, null, null, null, null, null, null);
}
- public static Provider getProvider(String domain, String geoipUrl, String providerIp, String providerApiIp, String caCertFile, String providerJson, String eipServiceJson) {
+ public static Provider getProvider(String domain, String geoipUrl, String providerIp, String providerApiIp, String caCertFile, String providerJson, String eipServiceJson, String geoIpJson) {
if (domain == null)
domain = "https://riseup.net";
if (geoipUrl == null)
@@ -72,6 +72,9 @@ public class TestSetupHelper {
if (eipServiceJson == null) {
eipServiceJson = "riseup.service.json";
}
+ if (geoIpJson == null) {
+ geoIpJson = "riseup.geoip.json";
+ }
try {
Provider p = new Provider(
@@ -86,6 +89,10 @@ public class TestSetupHelper {
JSONObject eipServiceJsonObject = new JSONObject(
getInputAsString(TestSetupHelper.class.getClassLoader().getResourceAsStream(eipServiceJson)));
p.setEipServiceJson(eipServiceJsonObject);
+
+ JSONObject geoIpJsonObject = new JSONObject(
+ getInputAsString(TestSetupHelper.class.getClassLoader().getResourceAsStream(geoIpJson)));
+ p.setGeoIpJson(geoIpJsonObject);
return p;
} catch (IOException | JSONException e) {
e.printStackTrace();