From 6de677328611b79a9fa335349a773f085652c54c Mon Sep 17 00:00:00 2001 From: Michael Morales Date: Mon, 6 Mar 2023 10:24:11 +0100 Subject: [PATCH] (Fix) #10 Removed dependency issue test functions --- .../java/org/jabref/logic/net/ProxyTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/test/java/org/jabref/logic/net/ProxyTest.java diff --git a/src/test/java/org/jabref/logic/net/ProxyTest.java b/src/test/java/org/jabref/logic/net/ProxyTest.java new file mode 100644 index 00000000000..3c5c77cbd46 --- /dev/null +++ b/src/test/java/org/jabref/logic/net/ProxyTest.java @@ -0,0 +1,36 @@ +package org.jabref.logic.net; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; +public class ProxyTest { + /** + * The test checks if ProxyPreference class is still able to store password and use it from memory, + * even though it's no longer stored in register. + */ + @Test + public void testProxyPreferencesStorePassword() { + //mock data + Boolean useProxy = true; + String hostname = "testName"; + String port = "8080"; + Boolean useAuthentication = true; + String username = "testUserName"; + String password = "testPassword"; + //Creates proxy preference + ProxyPreferences proxyPref = new ProxyPreferences( + useProxy, + hostname, + port, + useAuthentication, + username, + password); + //Check if mock data is stored in object memory and can be extracted + assertEquals(proxyPref.shouldUseProxy(), true); + assertEquals(proxyPref.getHostname(), hostname); + assertEquals(proxyPref.getPort(), port); + assertEquals(proxyPref.shouldUseAuthentication(), true); + assertEquals(proxyPref.getUsername(), username); + assertEquals(proxyPref.getPassword(), password); + } +}