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:
@@ -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("/");
|
||||
|
||||
Reference in New Issue
Block a user