3737import static org .junit .Assert .assertNotNull ;
3838import static org .junit .Assert .assertNull ;
3939import static org .junit .Assert .assertTrue ;
40+ import static quickfix .mina .ProtocolFactory .PROXY_AUTHORIZATION_HEADER ;
4041
4142public class ProtocolFactoryTest {
4243
@@ -69,9 +70,9 @@ public void shouldSetBasicAuthorizationHeaderForHttpProxy() throws ConfigError {
6970
7071 Map <String , List <String >> headers = request .getHeaders ();
7172 assertNotNull ("Headers should not be null" , headers );
72- assertTrue ("Headers should contain Proxy-Authorization" , headers .containsKey ("Proxy-Authorization" ));
73+ assertTrue ("Headers should contain Proxy-Authorization" , headers .containsKey (PROXY_AUTHORIZATION_HEADER ));
7374
74- List <String > authHeaders = headers .get ("Proxy-Authorization" );
75+ List <String > authHeaders = headers .get (PROXY_AUTHORIZATION_HEADER );
7576 assertNotNull ("Proxy-Authorization header should not be null" , authHeaders );
7677 assertEquals ("Should have exactly one Proxy-Authorization header" , 1 , authHeaders .size ());
7778
@@ -100,7 +101,7 @@ public void shouldNotSetAuthorizationHeaderForNTLMAuthentication() throws Config
100101 Map <String , List <String >> headers = request .getHeaders ();
101102 // NTLM requires multi-step handshake, so Proxy-Authorization header should not be set upfront
102103 assertTrue ("Headers should be null or not contain Proxy-Authorization for NTLM" ,
103- headers == null || !headers .containsKey ("Proxy-Authorization" ));
104+ headers == null || !headers .containsKey (PROXY_AUTHORIZATION_HEADER ));
104105
105106 // Verify NTLM properties are set correctly for the MINA proxy handler to use
106107 Map <String , String > props = request .getProperties ();
@@ -124,6 +125,6 @@ public void shouldNotSetAuthorizationHeaderWhenCredentialsNotProvided() throws C
124125 Map <String , List <String >> headers = request .getHeaders ();
125126 // Headers should either be null or not contain Proxy-Authorization
126127 assertTrue ("Headers should be null or empty when no credentials provided" ,
127- headers == null || !headers .containsKey ("Proxy-Authorization" ));
128+ headers == null || !headers .containsKey (PROXY_AUTHORIZATION_HEADER ));
128129 }
129130}
0 commit comments