summaryrefslogtreecommitdiff
path: root/app/src/test/java/se
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-01-23 21:18:17 -0600
committercyberta <cyberta@riseup.net>2020-01-23 21:18:17 -0600
commitc4aa8b7a5fc52627997a18f9d04669c8f9734dc2 (patch)
tree2e19d39f89b699d93ce3e237077a394ecdd9eae2 /app/src/test/java/se
parentfb636669e94cce736ac7f092d72c5d5e14296599 (diff)
fix tests with regard to provider initialization
Diffstat (limited to 'app/src/test/java/se')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/ProviderTest.java2
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java14
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java4
3 files changed, 11 insertions, 9 deletions
diff --git a/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java b/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
index bb809a79..0f9d358e 100644
--- a/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
@@ -54,6 +54,7 @@ public class ProviderTest {
null,
null,
null,
+ null,
"ptdemo.bitmask.eip-service.json");
assertTrue(p1.supportsPluggableTransports());
}
@@ -65,6 +66,7 @@ public class ProviderTest {
null,
null,
null,
+ null,
"eip-service-two-gateways.json");
assertFalse(p1.supportsPluggableTransports());
}
diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
index 4d48372c..417c4bfc 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
@@ -107,7 +107,7 @@ public class GatewaysManagerTest {
@Test
public void testGatewayManagerFromCurrentProvider_misconfiguredProvider_noGateways() throws IOException, NullPointerException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_misconfigured_gateway.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_misconfigured_gateway.json");
MockHelper.mockProviderObserver(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals(0, gatewaysManager.size());
@@ -115,7 +115,7 @@ public class GatewaysManagerTest {
@Test
public void testGatewayManagerFromCurrentProvider_threeGateways() {
- Provider provider = getProvider(null, null, null, null, "ptdemo_three_mixed_gateways.json");
+ Provider provider = getProvider(null, null, null,null, null, "ptdemo_three_mixed_gateways.json");
MockHelper.mockProviderObserver(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals(3, gatewaysManager.size());
@@ -123,7 +123,7 @@ public class GatewaysManagerTest {
@Test
public void TestGetPosition_VpnProfileExtistingObfs4_returnPositionZero() throws JSONException, ConfigParser.ConfigParseError, IOException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_three_mixed_gateways.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_three_mixed_gateways.json");
JSONObject eipServiceJson = provider.getEipServiceJson();
JSONObject gateway1 = eipServiceJson.getJSONArray(GATEWAYS).getJSONObject(0);
MockHelper.mockProviderObserver(provider);
@@ -140,7 +140,7 @@ public class GatewaysManagerTest {
@Test
public void TestGetPosition_VpnProfileExtistingOpenvpn_returnPositionZero() throws JSONException, ConfigParser.ConfigParseError, IOException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_three_mixed_gateways.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_three_mixed_gateways.json");
JSONObject eipServiceJson = provider.getEipServiceJson();
JSONObject gateway1 = eipServiceJson.getJSONArray(GATEWAYS).getJSONObject(0);
MockHelper.mockProviderObserver(provider);
@@ -157,7 +157,7 @@ public class GatewaysManagerTest {
@Test
public void TestGetPosition_VpnProfileDifferentIp_returnMinusOne() throws JSONException, ConfigParser.ConfigParseError, IOException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_three_mixed_gateways.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_three_mixed_gateways.json");
JSONObject eipServiceJson = provider.getEipServiceJson();
JSONObject gateway1 = eipServiceJson.getJSONArray(GATEWAYS).getJSONObject(0);
MockHelper.mockProviderObserver(provider);
@@ -174,7 +174,7 @@ public class GatewaysManagerTest {
@Test
public void TestGetPosition_VpnProfileMoscow_returnOne() throws JSONException, ConfigParser.ConfigParseError, IOException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_three_mixed_gateways.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_three_mixed_gateways.json");
JSONObject eipServiceJson = provider.getEipServiceJson();
JSONObject gateway1 = eipServiceJson.getJSONArray(GATEWAYS).getJSONObject(1);
MockHelper.mockProviderObserver(provider);
@@ -191,7 +191,7 @@ public class GatewaysManagerTest {
@Test
public void TestSelectN_selectFirstObfs4Connection_returnThirdGateway() throws JSONException, ConfigParser.ConfigParseError, IOException {
- Provider provider = getProvider(null, null, null, null, "ptdemo_two_openvpn_one_pt_gateways.json");
+ Provider provider = getProvider(null, null, null, null, null, "ptdemo_two_openvpn_one_pt_gateways.json");
JSONObject eipServiceJson = provider.getEipServiceJson();
JSONObject gateway3 = eipServiceJson.getJSONArray(GATEWAYS).getJSONObject(2);
diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
index 1120c0da..94f7b9de 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
@@ -281,7 +281,7 @@ public class ProviderApiManagerTest {
@Test
public void test_handleIntentSetupProvider_preseededProviderAndCA_outdatedCertificate() throws IOException, CertificateEncodingException, NoSuchAlgorithmException, JSONException {
- Provider provider = getProvider(null ,null, "outdated_cert.pem", null, null);
+ Provider provider = getProvider(null ,null, null, "outdated_cert.pem", null, null);
mockProviderApiConnector(NO_ERROR);
providerApiManager = new ProviderApiManager(mockPreferences, mockResources, mockClientGenerator(), new TestProviderApiServiceCallback());
@@ -398,7 +398,7 @@ public class ProviderApiManagerTest {
@Test
public void test_handleIntentSetupProvider_outdatedPreseededProviderAndCA_successfulConfiguration() throws IOException, CertificateEncodingException, NoSuchAlgorithmException, JSONException {
- Provider provider = getProvider(null, null, null, "riseup_net_outdated_config.json", null);
+ Provider provider = getProvider(null, null, null, null, "riseup_net_outdated_config.json", null);
mockFingerprintForCertificate(" a5244308a1374709a9afce95e3ae47c1b44bc2398c0a70ccbf8b3a8a97f29494");
mockProviderApiConnector(NO_ERROR);