Harmonize `accesslog.enabled` flag for Undertow
Closes gh-12178
This commit is contained in:
parent
09ff815f00
commit
92d1c6126b
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue