|
|
|
|
@ -322,6 +322,18 @@ class TomcatWebServerFactoryCustomizerTests {
@@ -322,6 +322,18 @@ class TomcatWebServerFactoryCustomizerTests {
|
|
|
|
|
assertThat(remoteIpValve.getTrustedProxies()).isEqualTo("proxy1|proxy2"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void resourceCacheMatchesDefault() { |
|
|
|
|
TomcatServerProperties properties = new TomcatServerProperties(); |
|
|
|
|
customizeAndRunServer((server) -> { |
|
|
|
|
Tomcat tomcat = server.getTomcat(); |
|
|
|
|
Context context = (Context) tomcat.getHost().findChildren()[0]; |
|
|
|
|
assertThat(properties.getResource().isAllowCaching()).isEqualTo(context.getResources().isCachingAllowed()); |
|
|
|
|
assertThat(properties.getResource().getCacheMaxSize()) |
|
|
|
|
.isEqualTo(DataSize.ofKilobytes(context.getResources().getCacheMaxSize())); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void customStaticResourceAllowCaching() { |
|
|
|
|
bind("server.tomcat.resource.allow-caching=false"); |
|
|
|
|
@ -334,7 +346,7 @@ class TomcatWebServerFactoryCustomizerTests {
@@ -334,7 +346,7 @@ class TomcatWebServerFactoryCustomizerTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void customStaticResourceCacheMaxSize() { |
|
|
|
|
bind("server.tomcat.resource.cache-max-size=4096KB"); |
|
|
|
|
bind("server.tomcat.resource.cache-max-size=4MB"); |
|
|
|
|
customizeAndRunServer((server) -> { |
|
|
|
|
Tomcat tomcat = server.getTomcat(); |
|
|
|
|
Context context = (Context) tomcat.getHost().findChildren()[0]; |
|
|
|
|
|