summaryrefslogtreecommitdiff
path: root/app/src/test/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-07-15 16:35:13 +0200
committercyBerta <cyberta@riseup.net>2022-07-19 00:06:12 +0200
commit573ecb07e250baef999711e339008dc0f0d3bb0b (patch)
tree87b9be719910a9a6b817fd2e17184d7b0012853d /app/src/test/java/se
parent95c923f2850ac409e8413cc4902c69848c64d7c8 (diff)
fix tests
Diffstat (limited to 'app/src/test/java/se')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java61
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java34
2 files changed, 48 insertions, 47 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 729abcdf..ec57dfac 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
@@ -22,6 +22,7 @@ import de.blinkt.openvpn.VpnProfile;
import de.blinkt.openvpn.core.ConfigParser;
import de.blinkt.openvpn.core.connection.Connection;
import se.leap.bitmaskclient.base.models.Location;
+import se.leap.bitmaskclient.base.models.Pair;
import se.leap.bitmaskclient.base.models.Provider;
import se.leap.bitmaskclient.base.models.ProviderObservable;
import se.leap.bitmaskclient.base.utils.ConfigHelper;
@@ -115,7 +116,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OBFS4);
profile.mGatewayIp = "37.218.247.60";
@@ -130,7 +131,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OPENVPN);
profile.mGatewayIp = "37.218.247.60";
@@ -145,7 +146,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OBFS4);
profile.mGatewayIp = "37.218.247.60";
@@ -160,7 +161,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OPENVPN);
profile.mGatewayIp = "37.218.247.60";
@@ -175,7 +176,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OBFS4);
profile.mGatewayIp = "37.218.247.61";
@@ -190,7 +191,7 @@ public class GatewaysManagerTest {
MockHelper.mockProviderObservable(provider);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false);
+ VpnConfigGenerator configGenerator = new VpnConfigGenerator(provider.getDefinition(), secrets, gateway1, 3, false, false);
VpnProfile profile = configGenerator.createProfile(OBFS4);
profile.mGatewayIp = "3.21.247.89";
@@ -206,7 +207,7 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(true);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("37.12.247.10", gatewaysManager.select(0).getRemoteIP());
+ assertEquals("37.12.247.10", gatewaysManager.select(0).first.getRemoteIP());
}
@Test
@@ -219,9 +220,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("manila.bitmask.net", gatewaysManager.select(0).getHost());
- assertEquals("moscow.bitmask.net", gatewaysManager.select(1).getHost());
- assertEquals("pt.demo.bitmask.net", gatewaysManager.select(2).getHost());
+ assertEquals("manila.bitmask.net", gatewaysManager.select(0).first.getHost());
+ assertEquals("moscow.bitmask.net", gatewaysManager.select(1).first.getHost());
+ assertEquals("pt.demo.bitmask.net", gatewaysManager.select(2).first.getHost());
}
@Test
@@ -234,8 +235,8 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(true);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("moscow.bitmask.net", gatewaysManager.select(0).getHost());
- assertEquals("pt.demo.bitmask.net", gatewaysManager.select(1).getHost());
+ assertEquals("moscow.bitmask.net", gatewaysManager.select(0).first.getHost());
+ assertEquals("pt.demo.bitmask.net", gatewaysManager.select(1).first.getHost());
assertNull(gatewaysManager.select(2));
}
@@ -251,9 +252,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("mouette.riseup.net", gatewaysManager.select(0).getHost());
- assertEquals("hoatzin.riseup.net", gatewaysManager.select(1).getHost());
- assertEquals("zarapito.riseup.net", gatewaysManager.select(2).getHost());
+ assertEquals("mouette.riseup.net", gatewaysManager.select(0).first.getHost());
+ assertEquals("hoatzin.riseup.net", gatewaysManager.select(1).first.getHost());
+ assertEquals("zarapito.riseup.net", gatewaysManager.select(2).first.getHost());
}
@Test
@@ -267,9 +268,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("mouette.riseup.net", gatewaysManager.select(0).getHost());
- assertEquals("hoatzin.riseup.net", gatewaysManager.select(1).getHost());
- assertEquals("zarapito.riseup.net", gatewaysManager.select(2).getHost());
+ assertEquals("mouette.riseup.net", gatewaysManager.select(0).first.getHost());
+ assertEquals("hoatzin.riseup.net", gatewaysManager.select(1).first.getHost());
+ assertEquals("zarapito.riseup.net", gatewaysManager.select(2).first.getHost());
}
@Test
@@ -284,9 +285,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getPreferredCity(any(Context.class))).thenReturn("Paris");
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("Paris", gatewaysManager.select(0).getName());
- assertEquals("Paris", gatewaysManager.select(1).getName());
- assertEquals("Paris", gatewaysManager.select(2).getName());
+ assertEquals("Paris", gatewaysManager.select(0).first.getName());
+ assertEquals("Paris", gatewaysManager.select(1).first.getName());
+ assertEquals("Paris", gatewaysManager.select(2).first.getName());
assertEquals(null, gatewaysManager.select(3));
}
@@ -300,9 +301,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").getHost());
- assertEquals("hoatzin.riseup.net", gatewaysManager.select(1, "Paris").getHost());
- assertEquals("zarapito.riseup.net", gatewaysManager.select(2, "Paris").getHost());
+ assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").first.getHost());
+ assertEquals("hoatzin.riseup.net", gatewaysManager.select(1, "Paris").first.getHost());
+ assertEquals("zarapito.riseup.net", gatewaysManager.select(2, "Paris").first.getHost());
}
@Test
@@ -315,9 +316,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").getHost());
- assertEquals("hoatzin.riseup.net", gatewaysManager.select(1, "Paris").getHost());
- assertEquals("zarapito.riseup.net", gatewaysManager.select(2, "Paris").getHost());
+ assertEquals("mouette.riseup.net", gatewaysManager.select(0, "Paris").first.getHost());
+ assertEquals("hoatzin.riseup.net", gatewaysManager.select(1, "Paris").first.getHost());
+ assertEquals("zarapito.riseup.net", gatewaysManager.select(2, "Paris").first.getHost());
}
@Test
@@ -331,9 +332,9 @@ public class GatewaysManagerTest {
when(PreferenceHelper.getUseBridges(any(Context.class))).thenReturn(false);
GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
- assertEquals("Paris", gatewaysManager.select(0, "Paris").getName());
- assertEquals("Paris", gatewaysManager.select(1, "Paris").getName());
- assertEquals("Paris", gatewaysManager.select(2, "Paris").getName());
+ assertEquals("Paris", gatewaysManager.select(0, "Paris").first.getName());
+ assertEquals("Paris", gatewaysManager.select(1, "Paris").first.getName());
+ assertEquals("Paris", gatewaysManager.select(2, "Paris").first.getName());
assertEquals(null, gatewaysManager.select(3, "Paris"));
}
diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java
index 2431542f..1bd7894b 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java
@@ -1435,7 +1435,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v1_tcp_udp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_tcp_udp.json")));
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.get(OPENVPN).getConfigFile(context, false).trim().equals(expectedVPNConfig_v1_tcp_udp.trim()));
@@ -1444,7 +1444,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v1_udp_tcp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_udp_tcp.json")));
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.get(OPENVPN).getConfigFile(context, false).trim().equals(expectedVPNConfig_v1_udp_tcp.trim()));
@@ -1453,7 +1453,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v2_tcp_udp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_tcp_udp.json")));
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.get(OPENVPN).getConfigFile(context, false).trim().equals(expectedVPNConfig_v1_tcp_udp.trim()));
@@ -1462,7 +1462,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v2_udp_tcp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_udp_tcp.json")));
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.get(OPENVPN).getConfigFile(context, false).trim().equals(expectedVPNConfig_v1_udp_tcp.trim()));
@@ -1473,7 +1473,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4() throws Exception {
when(ConfigHelper.ObfsVpnHelper.useObfsVpn()).thenReturn(false);
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo.bitmask.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1485,7 +1485,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4_obfsvpn() throws Exception {
when(ConfigHelper.ObfsVpnHelper.useObfsVpn()).thenReturn(true);
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo.bitmask.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1496,7 +1496,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v3_ovpn_tcp_udp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_pt_tcp_udp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1507,7 +1507,7 @@ public class VpnConfigGeneratorTest {
@Test
public void testGenerateVpnProfile_v3_ovpn_udp_tcp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_pt_udp_tcp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1520,7 +1520,7 @@ public class VpnConfigGeneratorTest {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_pt_udp_tcp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
//delete "data-ciphers" from config to test if the resulting openvpn config file will contain the default value taken from "cipher" flag
generalConfig.put("data-ciphers", null);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1532,7 +1532,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v4_ovpn_tcp_udp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/ptdemo_pt_tcp_udp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/ptdemo_pt_tcp_udp.eip-service.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 4, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 4, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1544,7 +1544,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v4_ovpn_udp_tcp() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/ptdemo_pt_udp_tcp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/ptdemo_pt_udp_tcp.eip-service.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 4, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 4, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1557,7 +1557,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_ipv6only_allowOpenvpnIPv6Only() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv6.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv6.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OPENVPN));
}
@@ -1566,7 +1566,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4IPv6_skip() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv6.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv6.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
}
@@ -1578,7 +1578,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4IPv4AndIPv6_skipIPv6() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv4ipv6.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_ipv4ipv6.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1593,7 +1593,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4udp_skip() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_udp.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_udp.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertFalse(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1603,7 +1603,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_v3_obfs4UDPAndTCP_skipUDP() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_udptcp.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_misconfigured_udptcp.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, false, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));
@@ -1615,7 +1615,7 @@ public class VpnConfigGeneratorTest {
public void testGenerateVpnProfile_preferUDP_firstRemotesUDP() throws Exception {
gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/multiport_tcpudp_eip-service.json"))).getJSONArray("gateways").getJSONObject(0);
generalConfig = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("v4/multiport_tcpudp_eip-service.json"))).getJSONObject(OPENVPN_CONFIGURATION);
- vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, true);
+ vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 3, true, false);
HashMap<Connection.TransportType, VpnProfile> vpnProfiles = vpnConfigGenerator.generateVpnProfiles();
assertTrue(vpnProfiles.containsKey(OBFS4));
assertTrue(vpnProfiles.containsKey(OPENVPN));