summaryrefslogtreecommitdiff
path: root/app/src/test
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-10-23 00:59:46 +0200
committercyBerta <cyberta@riseup.net>2021-10-23 00:59:46 +0200
commit62d2bdacec6c54f4453f1ad20425e99254998e9a (patch)
tree747403fdc550e54e6201fd464ccdc49d25bb5011 /app/src/test
parent1640f7bbfa53b84ebf539f027d5cc3c9ba441401 (diff)
rename usePluggableTransports prefrence to useBridges, start snowflake if useBridges is true
Diffstat (limited to 'app/src/test')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java24
1 files changed, 12 insertions, 12 deletions
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 81fcd7d5..0c122c89 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
@@ -198,7 +198,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(true);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(true);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("37.12.247.10", gatewaysManager.select(0).getRemoteIP());
@@ -211,7 +211,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("manila.bitmask.net", gatewaysManager.select(0).getHost());
@@ -226,7 +226,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(true);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(true);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("moscow.bitmask.net", gatewaysManager.select(0).getHost());
@@ -242,7 +242,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
@@ -258,7 +258,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
@@ -275,7 +275,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
@@ -292,7 +292,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").getHost());
@@ -307,7 +307,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").getHost());
@@ -323,7 +323,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertEquals("Paris", gatewaysManager.select(0, "Paris").getName());
@@ -340,7 +340,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
//use openvpn, not pluggable transports
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
assertNull(gatewaysManager.select(0, "Stockholm"));
}
@@ -351,7 +351,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(false);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
List<Location> locations = gatewaysManager.getGatewayLocations();
@@ -372,7 +372,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObserver(provider);
mockStatic(PreferenceHelper.class);
- when(PreferenceHelper.getUsePluggableTransports(any(Context.class))).thenReturn(true);
+ when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(true);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
List<Location> locations = gatewaysManager.getGatewayLocations();