@Test public void should_create_http_client_without_httpProxy() { AgentConfig config = AgentConfigFactory.createSampleAgentConfig().toBuilder() .httpProxyUsername("proxyUsername") .build(); OkHttpClient httpClient = config.getHttpClient(); assertThat(httpClient, not(nullValue())); assertThat(httpClient.proxy(), nullValue()); Authenticator authenticator = httpClient.proxyAuthenticator(); assertThat(authenticator, is(Authenticator.NONE)); }
public OkHttpClient getHttpClient() { if (httpClient == null) { validate(); OkHttpClient.Builder builder = new OkHttpClient.Builder() .connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS) .writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS); Proxy proxy = createHttpProxy(); if (proxy != null) { builder.proxy(proxy); } Authenticator proxyAuthenticator = createProxyAuthenticator(); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } httpClient = builder.build(); } return httpClient; }
AgentConfig implements Serializable { public OkHttpClient getHttpClient() { if (httpClient == null) { validate(); OkHttpClient.Builder builder = new OkHttpClient.Builder() .connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS) .writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS); Proxy proxy = createHttpProxy(); if (proxy != null) { builder.proxy(proxy); } Authenticator proxyAuthenticator = createProxyAuthenticator(); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } httpClient = builder.build(); } return httpClient; } }
AgentConfig implements Serializable { public OkHttpClient getHttpClient() { if (httpClient == null) { validate(); OkHttpClient.Builder builder = new OkHttpClient.Builder() .connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS) .writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS); Proxy proxy = createHttpProxy(); if (proxy != null) { builder.proxy(proxy); } Authenticator proxyAuthenticator = createProxyAuthenticator(); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } httpClient = builder.build(); } return httpClient; }  }
AgentConfig implements Serializable { public OkHttpClient getHttpClient() { if (httpClient == null) { validate(); OkHttpClient.Builder builder = new OkHttpClient.Builder() .connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS) .writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS); Proxy proxy = createHttpProxy(); if (proxy != null) { builder.proxy(proxy); } Authenticator proxyAuthenticator = createProxyAuthenticator(); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } httpClient = builder.build(); } return httpClient; }  List<String> getNormalizedPackages(); List<String> getNormalizedExcludePackages(); List<File> getCodeBaseFiles(); MethodAnalyzer getMethodAnalyzer(); String getPollConfigRequestEndpoint(); String getCodeBaseUploadEndpoint(); String getInvocationDataUploadEndpoint(); String getResolvedAppVersion(); OkHttpClient getHttpClient(); String getFilenamePrefix(@NonNull String prefix); CommonPublicationData2 commonPublicationData(); }
AgentConfig implements Serializable { public OkHttpClient getHttpClient() { if (httpClient == null) { validate(); OkHttpClient.Builder builder = new OkHttpClient.Builder() .connectTimeout(httpConnectTimeoutSeconds, TimeUnit.SECONDS) .writeTimeout(httpWriteTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(httpReadTimeoutSeconds, TimeUnit.SECONDS); Proxy proxy = createHttpProxy(); if (proxy != null) { builder.proxy(proxy); } Authenticator proxyAuthenticator = createProxyAuthenticator(); if (proxyAuthenticator != null) { builder.proxyAuthenticator(proxyAuthenticator); } httpClient = builder.build(); } return httpClient; }  List<String> getNormalizedPackages(); List<String> getNormalizedExcludePackages(); List<File> getCodeBaseFiles(); MethodAnalyzer getMethodAnalyzer(); String getPollConfigRequestEndpoint(); String getCodeBaseUploadEndpoint(); String getInvocationDataUploadEndpoint(); String getResolvedAppVersion(); OkHttpClient getHttpClient(); String getFilenamePrefix(@NonNull String prefix); CommonPublicationData2 commonPublicationData(); static final String INVOCATIONS_BASENAME; static final String JVM_BASENAME; }