Skip to content

Commit

Permalink
Make HttpClientGitHubConnector the default connector for Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Nov 21, 2021
1 parent 742ce54 commit 84b6b64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.jenkins-ci</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 84b6b64

Please sign in to comment.