summaryrefslogtreecommitdiff
path: root/app/src/sharedTest
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-07-24 10:20:22 -0700
committercyberta <cyberta@riseup.net>2020-07-24 10:20:22 -0700
commitbdd909d1faae569f27d61ad510d11fad74a5a27c (patch)
treec3266b79c930a6a902814e6c58c457280ed67c2a /app/src/sharedTest
parent4198c9b3bb1fee4bfcb3009ac9d80610ead13466 (diff)
parent38f5720502fda7b89ce204fe4afdffa67ac0ae82 (diff)
Merge branch 'support_geoip' into 'master'
Support geoip See merge request leap/bitmask_android!108
Diffstat (limited to 'app/src/sharedTest')
-rw-r--r--app/src/sharedTest/java/se.leap.bitmaskclient/testutils/TestSetupHelper.java14
1 files changed, 12 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 c7c85f8d..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,12 +51,14 @@ public class TestSetupHelper {
public static Provider getConfiguredProvider() throws IOException, JSONException {
- return getProvider(null, null, null, null, null, null);
+ return getProvider(null, null, null, null, null, null, null, null);
}
- public static Provider getProvider(String domain, 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)
+ geoipUrl = "https://api.black.riseup.net:9001/json";
if (providerIp == null) {
providerIp = "";
}
@@ -70,10 +72,14 @@ public class TestSetupHelper {
if (eipServiceJson == null) {
eipServiceJson = "riseup.service.json";
}
+ if (geoIpJson == null) {
+ geoIpJson = "riseup.geoip.json";
+ }
try {
Provider p = new Provider(
domain,
+ geoipUrl,
providerIp,
providerApiIp,
getInputAsString(TestSetupHelper.class.getClassLoader().getResourceAsStream(caCertFile)),
@@ -83,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();