summaryrefslogtreecommitdiff
path: root/app/src/test/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-09-20 00:07:44 +0200
committercyBerta <cyberta@riseup.net>2019-09-20 00:07:44 +0200
commit67a2040e96048e164b592fab4b0e8f123a7dd68f (patch)
treef518014d060e61548c7e10407f0c29a674273233 /app/src/test/java/se
parent9044c3fdc13f02b7c21bb181d769fadb71924b75 (diff)
add supportsPluggableTransports() to Provider class including Tests
Diffstat (limited to 'app/src/test/java/se')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/ProviderTest.java21
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java4
2 files changed, 23 insertions, 2 deletions
diff --git a/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java b/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
index a141edec..c4b8f65e 100644
--- a/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/ProviderTest.java
@@ -46,4 +46,25 @@ public class ProviderTest {
assertTrue(defaultProviders.contains(p2));
assertFalse(defaultProviders.contains(p3));
}
+
+ @Test
+ public void testIsPluggableTransportsSupported_Obfs4_returnsTrue() throws Exception {
+ Provider p1 = TestSetupHelper.getProvider(
+ "https://pt.demo.bitmask.net",
+ null,
+ null,
+ "ptdemo.bitmask.eip-service.json");
+ assertTrue(p1.supportsPluggableTransports());
+ }
+
+ @Test
+ public void testIsPluggableTransportsSupported_noObfs4_returnsFalse() throws Exception {
+ Provider p1 = TestSetupHelper.getProvider(
+ null,
+ null,
+ null,
+ "eip-service-two-gateways.json");
+ assertFalse(p1.supportsPluggableTransports());
+ }
+
}
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 3070fc0b..1a2ce49d 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
@@ -267,7 +267,7 @@ public class ProviderApiManagerTest {
@Test
public void test_handleIntentSetupProvider_preseededProviderAndCA_outdatedCertificate() throws IOException, CertificateEncodingException, NoSuchAlgorithmException, JSONException {
- Provider provider = getProvider(null ,"outdated_cert.pem", null);
+ Provider provider = getProvider(null ,"outdated_cert.pem", null, null);
mockProviderApiConnector(NO_ERROR);
providerApiManager = new ProviderApiManager(mockPreferences, mockResources, mockClientGenerator(), new TestProviderApiServiceCallback());
@@ -384,7 +384,7 @@ public class ProviderApiManagerTest {
@Test
public void test_handleIntentSetupProvider_outdatedPreseededProviderAndCA_successfulConfiguration() throws IOException, CertificateEncodingException, NoSuchAlgorithmException, JSONException {
- Provider provider = getProvider(null, null, "riseup_net_outdated_config.json");
+ Provider provider = getProvider(null, null, "riseup_net_outdated_config.json", null);
mockFingerprintForCertificate(" a5244308a1374709a9afce95e3ae47c1b44bc2398c0a70ccbf8b3a8a97f29494");
mockProviderApiConnector(NO_ERROR);