From 6aafd792efa3501dfe5e203c7587cd7089df888a Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 12 Apr 2023 09:46:45 +0200 Subject: fix sanity checks for the case of decoupled bridges --- .../se/leap/bitmaskclient/eip/GatewaysManagerTest.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'app/src/test/java/se') 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 @@ -92,14 +92,6 @@ public class GatewaysManagerTest { assertEquals(0, gatewaysManager.size()); } - @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); @@ -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)); } -- cgit v1.2.3