diff --git a/src/main/java/org/kohsuke/github/internal/DefaultGitHubConnector.java b/src/main/java/org/kohsuke/github/internal/DefaultGitHubConnector.java index 1f7d488036..1b00b01596 100644 --- a/src/main/java/org/kohsuke/github/internal/DefaultGitHubConnector.java +++ b/src/main/java/org/kohsuke/github/internal/DefaultGitHubConnector.java @@ -50,11 +50,11 @@ static GitHubConnector create(String defaultConnectorProperty) { } else if (defaultConnectorProperty.equalsIgnoreCase("httpclient")) { return new HttpClientGitHubConnector(); } else if (defaultConnectorProperty.equalsIgnoreCase("default")) { - // try { - // return new HttpClientGitHubConnector(); - // } catch (UnsupportedOperationException | LinkageError e) { - return new GitHubConnectorHttpConnectorAdapter(HttpConnector.DEFAULT); - // } + try { + return new HttpClientGitHubConnector(); + } catch (UnsupportedOperationException | LinkageError e) { + return new GitHubConnectorHttpConnectorAdapter(HttpConnector.DEFAULT); + } } else { throw new IllegalStateException( "Property 'test.github.connector' must reference a valid built-in connector - okhttp, okhttpconnector, urlconnection, or default."); diff --git a/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java b/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java index 7469f64069..e7f66b1ff1 100644 --- a/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java +++ b/src/test/java/org/kohsuke/github/internal/DefaultGitHubConnectorTest.java @@ -37,8 +37,6 @@ public void testCreate() throws Exception { connector = DefaultGitHubConnector.create("default"); - // Current implementation never uses httpclient for default. - usingHttpClient = false; if (usingHttpClient) { assertThat(connector, instanceOf(HttpClientGitHubConnector.class)); } else {