|
|
@ -17,8 +17,11 @@
|
|
|
|
package org.springframework.boot.autoconfigure.netty;
|
|
|
|
package org.springframework.boot.autoconfigure.netty;
|
|
|
|
|
|
|
|
|
|
|
|
import io.netty.util.ResourceLeakDetector;
|
|
|
|
import io.netty.util.ResourceLeakDetector;
|
|
|
|
|
|
|
|
import io.netty.util.ResourceLeakDetector.Level;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.test.util.ReflectionTestUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -31,8 +34,9 @@ class NettyPropertiesTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void defaultValueShouldMatchNettys() {
|
|
|
|
void defaultValueShouldMatchNettys() {
|
|
|
|
NettyProperties properties = new NettyProperties();
|
|
|
|
NettyProperties properties = new NettyProperties();
|
|
|
|
assertThat(ResourceLeakDetector.Level.valueOf(properties.getLeakDetection().name()))
|
|
|
|
ResourceLeakDetector.Level defaultLevel = (Level) ReflectionTestUtils.getField(ResourceLeakDetector.class,
|
|
|
|
.isEqualTo(ResourceLeakDetector.getLevel());
|
|
|
|
"DEFAULT_LEVEL");
|
|
|
|
|
|
|
|
assertThat(ResourceLeakDetector.Level.valueOf(properties.getLeakDetection().name())).isEqualTo(defaultLevel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|