|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -325,6 +325,24 @@ public class TomcatWebServerFactoryCustomizerTests {
|
|
|
|
assertThat(factory.getEngineValves()).isEmpty();
|
|
|
|
assertThat(factory.getEngineValves()).isEmpty();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void accessLogMaxDaysDefault() {
|
|
|
|
|
|
|
|
bind("server.tomcat.accesslog.enabled=true");
|
|
|
|
|
|
|
|
TomcatServletWebServerFactory factory = customizeAndGetFactory();
|
|
|
|
|
|
|
|
assertThat(((AccessLogValve) factory.getEngineValves().iterator().next())
|
|
|
|
|
|
|
|
.getMaxDays()).isEqualTo(
|
|
|
|
|
|
|
|
this.serverProperties.getTomcat().getAccesslog().getMaxDays());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void accessLoMaxDaysCanBeRedefined() {
|
|
|
|
|
|
|
|
bind("server.tomcat.accesslog.enabled=true",
|
|
|
|
|
|
|
|
"server.tomcat.accesslog.max-days=20");
|
|
|
|
|
|
|
|
TomcatServletWebServerFactory factory = customizeAndGetFactory();
|
|
|
|
|
|
|
|
assertThat(((AccessLogValve) factory.getEngineValves().iterator().next())
|
|
|
|
|
|
|
|
.getMaxDays()).isEqualTo(20);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void bind(String... inlinedProperties) {
|
|
|
|
private void bind(String... inlinedProperties) {
|
|
|
|
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
|
|
|
|
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
|
|
|
|
inlinedProperties);
|
|
|
|
inlinedProperties);
|
|
|
|