}
// remote auth is NTLM
{
final DefaultRemoteStorageContext drsc = new DefaultRemoteStorageContext(null);
drsc.setRemoteAuthenticationSettings(new NtlmRemoteAuthenticationSettings("a", "b", "c", "d"));
Assert.assertTrue("NTLM target auth-proxy set", testSubject.reuseConnectionsNeeded(drsc));
}
// HTTP proxy is NTLM
{
final RemoteHttpProxySettings http = new DefaultRemoteHttpProxySettings();
http.setProxyAuthentication(new NtlmRemoteAuthenticationSettings("a", "b", "c", "d"));
final RemoteHttpProxySettings https = new DefaultRemoteHttpProxySettings();
when(remoteProxySettings.getHttpProxySettings()).thenReturn(http);
when(remoteProxySettings.getHttpsProxySettings()).thenReturn(https);
Assert.assertTrue("NTLM HTTP proxy auth-proxy set",
testSubject.reuseConnectionsNeeded(globalRemoteStorageContext));
}
// HTTPS proxy is NTLM
{
final RemoteHttpProxySettings http = new DefaultRemoteHttpProxySettings();
final RemoteHttpProxySettings https = new DefaultRemoteHttpProxySettings();
https.setProxyAuthentication(new NtlmRemoteAuthenticationSettings("a", "b", "c", "d"));
when(remoteProxySettings.getHttpProxySettings()).thenReturn(http);
when(remoteProxySettings.getHttpsProxySettings()).thenReturn(https);
Assert.assertTrue("NTLM HTTPS proxy auth-proxy set",
testSubject.reuseConnectionsNeeded(globalRemoteStorageContext));
}