@Test void gzipEnabled() throws IOException, InterruptedException { interceptor.enableGzip(); RecordedRequest recordedRequest = newCall("/api/v2/users"); Assertions.assertThat(recordedRequest.getHeader("Content-Encoding")).isNull(); Assertions.assertThat(recordedRequest.getHeader("Accept-Encoding")).doesNotContain("gzip"); recordedRequest = newCall("/api/v2/write"); Assertions.assertThat(recordedRequest.getHeader("Content-Encoding")).isEqualTo("gzip"); Assertions.assertThat(recordedRequest.getHeader("Accept-Encoding")).doesNotContain("gzip"); recordedRequest = newCall("/api/v2/query"); Assertions.assertThat(recordedRequest.getHeader("Content-Encoding")).isNull(); Assertions.assertThat(recordedRequest.getHeader("Accept-Encoding")).isEqualTo("gzip"); }
public void enableGzip() { enabled.set(true); }
GzipInterceptor implements Interceptor { public void enableGzip() { enabled.set(true); } }
GzipInterceptor implements Interceptor { public void enableGzip() { enabled.set(true); }  }
GzipInterceptor implements Interceptor { public void enableGzip() { enabled.set(true); }  @Nonnull @Override Response intercept(@Nonnull final Chain chain); void enableGzip(); boolean isEnabledGzip(); void disableGzip(); }
GzipInterceptor implements Interceptor { public void enableGzip() { enabled.set(true); }  @Nonnull @Override Response intercept(@Nonnull final Chain chain); void enableGzip(); boolean isEnabledGzip(); void disableGzip();  }