summaryrefslogtreecommitdiff
path: root/app/src/test
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-02-05 05:06:42 +0100
committercyBerta <cyberta@riseup.net>2022-02-05 05:06:56 +0100
commit2375f6a9f2ec395391cca524176d9c54635a14de (patch)
tree971b985f24498d6488c41caba252f64395f25b2f /app/src/test
parent1c605888bab7d7ebed2a401b90a018a8e109e7e2 (diff)
fix NPE in GatewaysManager
Diffstat (limited to 'app/src/test')
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java8
1 files changed, 8 insertions, 0 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 a3cde58b..729abcdf 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java
@@ -20,6 +20,7 @@ import java.util.List;
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.Provider;
import se.leap.bitmaskclient.base.models.ProviderObservable;
@@ -508,6 +509,13 @@ public class GatewaysManagerTest {
assertEquals("Amsterdam", locations.get(2).getName());
}
+ @Test
+ public void testGetLoadForLocation_() {
+ MockHelper.mockProviderObservable(null);
+ GatewaysManager gatewaysManager = new GatewaysManager(mockContext);
+ assertEquals(GatewaysManager.Load.UNKNOWN, gatewaysManager.getLoadForLocation("unknown city", OPENVPN));
+ }
+
private String getJsonStringFor(String filename) throws IOException {
return TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream(filename));
}