@Test public void should_enable_proxy_authentication_if_system_properties_for_proxy_host_and_credentials_are_defined() { HttpClient.SystemProperties sysProps = mock(HttpClient.SystemProperties.class); when(sysProps.getProperty("http.proxyHost")).thenReturn("proxy.mydomain"); when(sysProps.getProperty("http.proxyUser")).thenReturn("foo"); when(sysProps.getProperty("http.proxyPassword")).thenReturn("bar"); HttpClient underTest = new HttpClient.Builder().setSystemProperties(sysProps).build(); HttpClient.ProxyAuthenticator proxyAuthenticator = (HttpClient.ProxyAuthenticator) underTest.getUnderlying().proxyAuthenticator(); assertThat(proxyAuthenticator.getLogin()).isEqualTo("foo"); assertThat(proxyAuthenticator.getPassword()).isEqualTo("bar"); }
OkHttpClient getUnderlying() { return okClient; }
HttpClient { OkHttpClient getUnderlying() { return okClient; } }
HttpClient { OkHttpClient getUnderlying() { return okClient; } private  HttpClient(OkHttpClient okClient); }
HttpClient { OkHttpClient getUnderlying() { return okClient; } private  HttpClient(OkHttpClient okClient); HttpCall newCall(HttpUrl url); }
HttpClient { OkHttpClient getUnderlying() { return okClient; } private  HttpClient(OkHttpClient okClient); HttpCall newCall(HttpUrl url);  }