diff --git a/spring-boot-modules/spring-boot-annotations/src/test/java/com/baeldung/annotations/conditional/DevEnvLoggingConfigurationUnitTest.java b/spring-boot-modules/spring-boot-annotations/src/test/java/com/baeldung/annotations/conditional/DevEnvLoggingConfigurationUnitTest.java index 2815fda82e..e7c1975127 100644 --- a/spring-boot-modules/spring-boot-annotations/src/test/java/com/baeldung/annotations/conditional/DevEnvLoggingConfigurationUnitTest.java +++ b/spring-boot-modules/spring-boot-annotations/src/test/java/com/baeldung/annotations/conditional/DevEnvLoggingConfigurationUnitTest.java @@ -31,6 +31,8 @@ public class DevEnvLoggingConfigurationUnitTest { @Test public void whenDevEnvNotEnabled_thenDevEnvLoggingConfigurationAndLoggingServiceShouldNotBeCreated() { + System.setProperty("env", "not-dev"); + contextRunner .withUserConfiguration(ConditionalTestConfiguration.class) .run(context ->