File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
src/main/java/org/kohsuke/github Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 153153 </limit >
154154 </limits >
155155 <excludes >
156- <!-- Code implemented externally -->
157- <exclude >org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory.**</exclude >
158- <exclude >org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory</exclude >
159-
160156 <!-- Sample only -->
161157 <exclude >org.kohsuke.github.example.*</exclude >
162158
575571 <plugin >
576572 <artifactId >maven-surefire-plugin</artifactId >
577573 <executions >
574+ <execution >
575+ <id >okhttp-test</id >
576+ <phase >test</phase >
577+ <goals >
578+ <goal >test</goal >
579+ </goals >
580+ <configuration >
581+ <excludesFile >src/test/resources/slow-or-flaky-tests.txt</excludesFile >
582+ <argLine >@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.useOkHttp</argLine >
583+ </configuration >
584+ </execution >
578585 <execution >
579586 <id >slow-or-flaky-test</id >
580587 <phase >test</phase >
Original file line number Diff line number Diff line change 11package org .kohsuke .github ;
22
3+ import okhttp3 .OkHttpClient ;
4+ import org .kohsuke .github .extras .okhttp3 .OkHttpConnector ;
5+
36import java .io .IOException ;
47import java .net .HttpURLConnection ;
58import java .net .URL ;
@@ -33,7 +36,9 @@ default HttpURLConnection connect(URL url) throws IOException {
3336 /**
3437 * Default implementation that uses {@link URL#openConnection()}.
3538 */
36- GitHubConnector DEFAULT = new GitHubConnectorHttpConnectorAdapter (HttpConnector .DEFAULT );
39+ GitHubConnector DEFAULT = (System .getProperty ("test.github.useOkHttp" , "false" ) != "false" )
40+ ? new OkHttpConnector (new OkHttpClient .Builder ().build ())
41+ : new GitHubConnectorHttpConnectorAdapter (HttpConnector .DEFAULT );
3742
3843 GitHubConnector OFFLINE = new GitHubConnectorHttpConnectorAdapter (HttpConnector .OFFLINE );
3944}
You can’t perform that action at this time.
0 commit comments