diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index c8a47f46b8..34930dbff1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -1058,7 +1058,7 @@ public class ServerProperties { /** * Whether to enable the access log. */ - private Boolean enabled; + private boolean enabled = false; /** * Format pattern for access logs. @@ -1085,11 +1085,11 @@ public class ServerProperties { */ private boolean rotate = true; - public Boolean getEnabled() { + public boolean isEnabled() { return this.enabled; } - public void setEnabled(Boolean enabled) { + public void setEnabled(boolean enabled) { this.enabled = enabled; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java index 9c022e4250..43f350d59b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizer.java @@ -69,7 +69,7 @@ public class UndertowWebServerFactoryCustomizer implements .to(factory::setWorkerThreads); propertyMapper.from(undertowProperties::getDirectBuffers) .to(factory::setUseDirectBuffers); - propertyMapper.from(accesslogProperties::getEnabled) + propertyMapper.from(accesslogProperties::isEnabled) .to(factory::setAccessLogEnabled); propertyMapper.from(accesslogProperties::getDir) .to(factory::setAccessLogDirectory); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizerTests.java index 5146117d8e..745c577829 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/UndertowWebServerFactoryCustomizerTests.java @@ -29,9 +29,7 @@ import org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebSer import org.springframework.mock.env.MockEnvironment; import org.springframework.test.context.support.TestPropertySourceUtils; -import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; /** @@ -102,14 +100,6 @@ public class UndertowWebServerFactoryCustomizerTests { verify(factory).setUseForwardHeaders(true); } - @Test - public void skipNullElementsForUndertow() { - ConfigurableUndertowWebServerFactory factory = mock( - ConfigurableUndertowWebServerFactory.class); - this.customizer.customize(factory); - verify(factory, never()).setAccessLogEnabled(anyBoolean()); - } - private void bind(String... inlinedProperties) { TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment, inlinedProperties);