|
5 | 5 | import java.util.Set; |
6 | 6 | import java.util.TreeSet; |
7 | 7 |
|
8 | | -import com.squareup.okhttp.OkHttpClient; |
9 | | -import com.squareup.okhttp.OkUrlFactory; |
10 | 8 | import jenkins.plugins.github.api.mock.MockGitHub; |
11 | 9 | import jenkins.plugins.github.api.mock.MockOrganization; |
12 | 10 | import jenkins.plugins.github.api.mock.MockUser; |
| 11 | +import okhttp3.OkHttpClient; |
13 | 12 | import org.junit.Test; |
14 | 13 | import org.junit.runner.RunWith; |
15 | 14 | import org.junit.runners.Parameterized; |
|
18 | 17 | import org.kohsuke.github.GHUser; |
19 | 18 | import org.kohsuke.github.GitHub; |
20 | 19 | import org.kohsuke.github.GitHubBuilder; |
21 | | -import org.kohsuke.github.HttpConnector; |
22 | | -import org.kohsuke.github.extras.OkHttpConnector; |
| 20 | +import org.kohsuke.github.connector.GitHubConnector; |
23 | 21 | import org.kohsuke.github.extras.okhttp3.OkHttpGitHubConnector; |
24 | 22 |
|
25 | 23 | import edu.umd.cs.findbugs.annotations.NonNull; |
@@ -52,13 +50,10 @@ public SmokeTest(IOFunction connectFunction) { |
52 | 50 |
|
53 | 51 | @Parameterized.Parameters(name = "connectFunction={index}") |
54 | 52 | public static IOFunction[] connectFunctions() { |
55 | | - HttpConnector okHttpConnector = new OkHttpConnector(new OkUrlFactory(new OkHttpClient())); |
56 | | - HttpConnector okHttp3Connector = new org.kohsuke.github.extras.okhttp3.OkHttpConnector(new okhttp3.OkHttpClient()); |
57 | | - OkHttpGitHubConnector okHttpGitHubConnector = new OkHttpGitHubConnector(new okhttp3.OkHttpClient()); |
| 53 | + OkHttpClient okHttpClient = new OkHttpClient(); |
| 54 | + GitHubConnector okHttpGitHubConnector = new OkHttpGitHubConnector(okHttpClient); |
58 | 55 | ArrayList<IOFunction> list = new ArrayList<>(); |
59 | 56 | list.add ((mock) -> GitHub.connectToEnterpriseAnonymously(mock.open())); |
60 | | - list.add ((mock) -> new GitHubBuilder().withConnector(okHttpConnector).withEndpoint(mock.open()).build()); |
61 | | - list.add ((mock) -> new GitHubBuilder().withConnector(okHttp3Connector).withEndpoint(mock.open()).build()); |
62 | 57 | list.add ((mock) -> new GitHubBuilder().withConnector(okHttpGitHubConnector).withEndpoint(mock.open()).build()); |
63 | 58 |
|
64 | 59 | return list.toArray(new IOFunction[] {}); |
|
0 commit comments