use of okhttp3.Authenticator in project okhttp-digest by rburgst.
the class ProxyAuthenticationManualTest method testConnection_WithProxyBasicAuthWithTunnel_Expect200.
@Test
public void testConnection_WithProxyBasicAuthWithTunnel_Expect200() throws IOException {
final BasicAuthenticator authenticator = givenBasicAuthenticator();
final OkHttpClient client = givenHttpClientWithProxyAuth(authenticator);
final Request request = new Request.Builder().url("https://www.google.com/favicon.ico").build();
Response response = client.newCall(request).execute();
assertEquals(200, response.code());
}
use of okhttp3.Authenticator in project okhttp-digest by rburgst.
the class ProxyAuthenticationManualTest method testConnection_WithProxyBasicAuthWithNotAllowedSites_Expect403.
@Test
public void testConnection_WithProxyBasicAuthWithNotAllowedSites_Expect403() throws IOException {
final BasicAuthenticator authenticator = givenBasicAuthenticator();
final OkHttpClient client = givenHttpClientWithProxyAuth(authenticator);
final Request request = new Request.Builder().url("http://www.youtube.com").build();
Response response = client.newCall(request).execute();
assertEquals(403, response.code());
}
use of okhttp3.Authenticator in project okhttp-digest by rburgst.
the class ProxyAuthenticationManualTest method testConnection_WithProxyDigestAuthWithoutTunnel_Expect200.
@Test
public void testConnection_WithProxyDigestAuthWithoutTunnel_Expect200() throws IOException {
final DigestAuthenticator authenticator = givenDigestAuthenticator();
final OkHttpClient client = givenHttpClientWithProxyAuth(authenticator);
final Request request = new Request.Builder().url("http://edition.cnn.com").build();
Response response = client.newCall(request).execute();
assertEquals(200, response.code());
}
use of okhttp3.Authenticator in project okhttp-digest by rburgst.
the class ProxyAuthenticationManualTest method testConnection_WithProxyBasicAuthWithoutTunnel_Expect200.
@Test
public void testConnection_WithProxyBasicAuthWithoutTunnel_Expect200() throws IOException {
final BasicAuthenticator authenticator = givenBasicAuthenticator();
final OkHttpClient client = givenHttpClientWithProxyAuth(authenticator);
final Request request = new Request.Builder().url("http://edition.cnn.com").build();
Response response = client.newCall(request).execute();
assertEquals(200, response.code());
}
use of okhttp3.Authenticator in project okhttp-digest by rburgst.
the class ProxyAuthenticationManualTest method testConnection_WithProxyDigestAuthWithTunnel_Expect200.
@Test
public void testConnection_WithProxyDigestAuthWithTunnel_Expect200() throws IOException {
final DigestAuthenticator authenticator = givenDigestAuthenticator();
final OkHttpClient client = givenHttpClientWithProxyAuth(authenticator);
final Request request = new Request.Builder().url("https://www.google.com/favicon.ico").build();
Response response = client.newCall(request).execute();
assertEquals(200, response.code());
}
Aggregations