mirror of
https://github.com/square/okhttp.git
synced 2025-11-27 18:21:14 +03:00
Cleanup HttpLoggingInterceptor (#4346)
* Use try-with-resources
* Make bodyHasUnknownEncoding() static
* Fix nits in HttpLoggingInterceptorTest
* Revert "Use try-with-resources"
This reverts commit 57dcd61a9e.
This commit is contained in:
committed by
Jesse Wilson
parent
ef34a41d09
commit
1f7e796e6e
@@ -59,8 +59,8 @@ public final class HttpLoggingInterceptorTest {
|
||||
|
||||
@Rule public final MockWebServer server = new MockWebServer();
|
||||
|
||||
private HandshakeCertificates handshakeCertificates = localhost();
|
||||
private HostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
|
||||
private final HandshakeCertificates handshakeCertificates = localhost();
|
||||
private final HostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
|
||||
private OkHttpClient client;
|
||||
private String host;
|
||||
private HttpUrl url;
|
||||
@@ -650,7 +650,7 @@ public final class HttpLoggingInterceptorTest {
|
||||
.assertNoMoreLogs();
|
||||
}
|
||||
|
||||
@Test public void isPlaintext() throws IOException {
|
||||
@Test public void isPlaintext() {
|
||||
assertTrue(HttpLoggingInterceptor.isPlaintext(new Buffer()));
|
||||
assertTrue(HttpLoggingInterceptor.isPlaintext(new Buffer().writeUtf8("abc")));
|
||||
assertTrue(HttpLoggingInterceptor.isPlaintext(new Buffer().writeUtf8("new\r\nlines")));
|
||||
|
||||
Reference in New Issue
Block a user