diff options
author | cyBerta <cyberta@riseup.net> | 2023-04-12 09:46:45 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-04-13 16:47:13 +0200 |
commit | 6aafd792efa3501dfe5e203c7587cd7089df888a (patch) | |
tree | 2dc4b4cd7a219bb8debc515c33cce3e109aba87f /app/src/test/java/se | |
parent | b006afb5e4410644a5050602cd37400ce2edb6b2 (diff) |
fix sanity checks for the case of decoupled bridges
Diffstat (limited to 'app/src/test/java/se')
-rw-r--r-- | app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java | 18 |
1 files changed, 8 insertions, 10 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 1b42b5d2..913a023a 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java @@ -93,14 +93,6 @@ public class GatewaysManagerTest { } @Test - public void testGatewayManagerFromCurrentProvider_misconfiguredProvider_noGateways() throws IOException, NullPointerException { - Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_misconfigured_gateway.json", null); - MockHelper.mockProviderObservable(provider); - GatewaysManager gatewaysManager = new GatewaysManager(mockContext); - assertEquals(0, gatewaysManager.size()); - } - - @Test public void testGatewayManagerFromCurrentProvider_threeGateways() { Provider provider = getProvider(null, null, null, null,null, null, "ptdemo_three_mixed_gateways.json", null); MockHelper.mockProviderObservable(provider); @@ -551,8 +543,6 @@ public class GatewaysManagerTest { assertEquals(0.3, gatewaysManager.getLocation("Amsterdam").getAverageLoad(OPENVPN)); } - - @Test public void testGetLoadForLocation_() { MockHelper.mockProviderObservable(null); @@ -560,6 +550,14 @@ public class GatewaysManagerTest { assertEquals(GatewaysManager.Load.UNKNOWN, gatewaysManager.getLoadForLocation("unknown city", OPENVPN)); } + @Test + public void testGatewayManagerFromCurrentProvider_decoupledBridges_twoGateways() throws IOException, NullPointerException { + Provider provider = getProvider(null, null, null, null, null, null, "decoupled_pt.eip-service.json", null); + MockHelper.mockProviderObservable(provider); + GatewaysManager gatewaysManager = new GatewaysManager(mockContext); + assertEquals(2, gatewaysManager.size()); + } + private String getJsonStringFor(String filename) throws IOException { return TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream(filename)); } |