1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-27 18:21:14 +03:00

Refactor towards an OkHttpClient.Builder.

Still some work to do on method naming, but this was the interesting part.
Also very much need to rename OkUrlFactory in tests to urlFactory, otherwise
the client.client stuff becomes madness.
This commit is contained in:
jwilson
2015-12-31 02:31:17 -05:00
parent db9c2db40b
commit f2461183e8
63 changed files with 1391 additions and 1069 deletions

View File

@@ -46,7 +46,7 @@ public final class HttpLoggingInterceptorTest {
@Rule public final MockWebServer server = new MockWebServer();
private final OkHttpClient client = new OkHttpClient();
private OkHttpClient client;
private String host;
private HttpUrl url;
@@ -64,8 +64,10 @@ public final class HttpLoggingInterceptorTest {
}
@Before public void setUp() {
client.networkInterceptors().add(networkInterceptor);
client.interceptors().add(applicationInterceptor);
client = new OkHttpClient.Builder()
.addNetworkInterceptor(networkInterceptor)
.addInterceptor(applicationInterceptor)
.build();
host = server.getHostName() + ":" + server.getPort();
url = server.url("/");