From 6c0bf4d7a52dd6e60f368e454dab7c91487c97ff Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 23 Apr 2018 00:05:22 +0200 Subject: Implement HTTP User/Password Authentication via UI (closes #861, #856) --- .../java/de/blinkt/openvpn/core/TestConfigParser.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'main/src/test') diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java index 6615a8f0..3e5c9895 100644 --- a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java +++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java @@ -40,7 +40,8 @@ public class TestConfigParser { ConfigParser cp = new ConfigParser(); cp.parseConfig(new StringReader(miniconfig + httpproxypass)); VpnProfile p = cp.convertProfile(); - Assert.assertTrue(p.mCustomConfigOptions.contains(httpproxypass)); + Assert.assertFalse(p.mCustomConfigOptions.contains(httpproxypass)); + } @@ -124,9 +125,18 @@ public class TestConfigParser { ConfigParser cp = new ConfigParser(); cp.parseConfig(new StringReader(proxy)); VpnProfile vp = cp.convertProfile(); - String config = vp.getConfigFile(RuntimeEnvironment.application, false); + String config = vp.getConfigFile(RuntimeEnvironment.application, true); Assert.assertTrue(config.contains("username12")); Assert.assertTrue(config.contains("http-proxy 1.2.3.4")); - } + + config = vp.getConfigFile(RuntimeEnvironment.application, false); + + Assert.assertFalse(config.contains("username12")); + Assert.assertFalse(config.contains("http-proxy 1.2.3.4")); + + Assert.assertTrue(vp.mConnections[0].mUseProxyAuth); + Assert.assertEquals(vp.mConnections[0].mProxyAuthUser, "username12"); + Assert.assertEquals(vp.mConnections[0].mProxyAuthPassword, "password34"); + } } -- cgit v1.2.3