File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/test/java/org/jabref/logic/net Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments