Skip to content

Commit 6de6773

Browse files
Michael MoralesMichael Morales
authored andcommitted
(Fix) #10 Removed dependency issue test functions
1 parent 74dc41b commit 6de6773

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.jabref.logic.net;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.*;
6+
public class ProxyTest {
7+
/**
8+
* The test checks if ProxyPreference class is still able to store password and use it from memory,
9+
* even though it's no longer stored in register.
10+
*/
11+
@Test
12+
public void testProxyPreferencesStorePassword() {
13+
//mock data
14+
Boolean useProxy = true;
15+
String hostname = "testName";
16+
String port = "8080";
17+
Boolean useAuthentication = true;
18+
String username = "testUserName";
19+
String password = "testPassword";
20+
//Creates proxy preference
21+
ProxyPreferences proxyPref = new ProxyPreferences(
22+
useProxy,
23+
hostname,
24+
port,
25+
useAuthentication,
26+
username,
27+
password);
28+
//Check if mock data is stored in object memory and can be extracted
29+
assertEquals(proxyPref.shouldUseProxy(), true);
30+
assertEquals(proxyPref.getHostname(), hostname);
31+
assertEquals(proxyPref.getPort(), port);
32+
assertEquals(proxyPref.shouldUseAuthentication(), true);
33+
assertEquals(proxyPref.getUsername(), username);
34+
assertEquals(proxyPref.getPassword(), password);
35+
}
36+
}

0 commit comments

Comments
 (0)