mirror of
https://github.com/square/okhttp.git
synced 2025-11-27 18:21:14 +03:00
@@ -130,6 +130,10 @@ public final class HttpLoggingInterceptor implements Interceptor {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Level getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
@Override public Response intercept(Chain chain) throws IOException {
|
||||
Level level = this.level;
|
||||
|
||||
|
||||
@@ -68,6 +68,16 @@ public final class HttpLoggingInterceptorTest {
|
||||
url = server.url("/");
|
||||
}
|
||||
|
||||
@Test public void levelGetter() {
|
||||
// The default is NONE.
|
||||
assertEquals(Level.NONE, applicationInterceptor.getLevel());
|
||||
|
||||
for (Level level : Level.values()) {
|
||||
applicationInterceptor.setLevel(level);
|
||||
assertEquals(level, applicationInterceptor.getLevel());
|
||||
}
|
||||
}
|
||||
|
||||
@Test public void setLevelShouldPreventNullValue() {
|
||||
try {
|
||||
applicationInterceptor.setLevel(null);
|
||||
|
||||
Reference in New Issue
Block a user