diff options
author | Arne Schwabe <arne@rfc2549.org> | 2018-04-23 00:05:22 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2018-04-23 00:05:36 +0200 |
commit | 6c0bf4d7a52dd6e60f368e454dab7c91487c97ff (patch) | |
tree | e96a5662f07a8c58630266d8276ea66bb069843b /main/src/test | |
parent | 869a0ce9cf26584edac321a2a7193bb8904888dc (diff) |
Implement HTTP User/Password Authentication via UI (closes #861, #856)
Diffstat (limited to 'main/src/test')
-rw-r--r-- | main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java | 16 |
1 files changed, 13 insertions, 3 deletions
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"); + } } |