Skip to content

Commit

Permalink
Added second test for requirment R2 with appropriate comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Morales committed Mar 2, 2023
1 parent 2e5b5c7 commit 3587914
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/test/java/org/jabref/logic/net/ProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,34 @@ public void testProxyPasswordNotStoredInRegister(){
preferences.put(PROXY_USERNAME, oldUsername);
preferences.put(PROXY_PASSWORD, oldPassword);
}

/**
* Add an additional test for testing that password get's stored somehow!
* 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(), "testName");
assertEquals(proxyPref.getPort(), port);
assertEquals(proxyPref.shouldUseAuthentication(), true);
assertEquals(proxyPref.getUsername(), username);
assertEquals(proxyPref.getPassword(), password);
}
}

0 comments on commit 3587914

Please sign in to comment.