Skip to content

Commit dd4e6b3

Browse files
committed
Move Log4J2 test inner types
Signed-off-by: hojooo <[email protected]>
1 parent 26db70e commit dd4e6b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import org.springframework.boot.logging.LoggingSystem;
6868
import org.springframework.boot.logging.LoggingSystemProperties;
6969
import org.springframework.boot.logging.LoggingSystemProperty;
70+
import org.springframework.boot.logging.log4j2.Log4j2RollingPolicySystemProperty;
7071
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
7172
import org.springframework.boot.testsupport.classpath.resources.WithResource;
7273
import org.springframework.boot.testsupport.logging.ConfigureClasspathToPreferLog4j2;
@@ -123,6 +124,7 @@ void cleanUp() {
123124
this.loggingSystem.getConfiguration().stop();
124125
this.loggingSystem.cleanUp();
125126
PluginRegistry.getInstance().clear();
127+
clearRollingPolicySystemProperties();
126128
}
127129

128130
@Test
@@ -137,6 +139,12 @@ void noFile(CapturedOutput output) {
137139
assertThat(configuration.getConfigurationSource().getFile()).isNotNull();
138140
}
139141

142+
private void clearRollingPolicySystemProperties() {
143+
for (Log4j2RollingPolicySystemProperty property : Log4j2RollingPolicySystemProperty.values()) {
144+
System.clearProperty(property.getEnvironmentVariableName());
145+
}
146+
}
147+
140148
@Test
141149
void withFile(CapturedOutput output) {
142150
this.loggingSystem.beforeInitialize();

0 commit comments

Comments
 (0)