File tree 2 files changed +14
-0
lines changed
main/java/org/springframework/boot/devtools/env
test/java/org/springframework/boot/devtools/autoconfigure
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
46
46
properties .put ("spring.mustache.cache" , "false" );
47
47
properties .put ("server.session.persistent" , "true" );
48
48
properties .put ("spring.h2.console.enabled" , "true" );
49
+ properties .put ("spring.resources.cache-period" , "0" );
49
50
PROPERTIES = Collections .unmodifiableMap (properties );
50
51
}
51
52
Original file line number Diff line number Diff line change 28
28
import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
29
29
import org .springframework .boot .SpringApplication ;
30
30
import org .springframework .boot .autoconfigure .thymeleaf .ThymeleafAutoConfiguration ;
31
+ import org .springframework .boot .autoconfigure .web .ResourceProperties ;
31
32
import org .springframework .boot .devtools .classpath .ClassPathChangedEvent ;
32
33
import org .springframework .boot .devtools .classpath .ClassPathFileSystemWatcher ;
33
34
import org .springframework .boot .devtools .filewatch .ChangedFiles ;
@@ -89,6 +90,13 @@ public void thymeleafCacheIsFalse() throws Exception {
89
90
assertThat (resolver .isCacheable (), equalTo (false ));
90
91
}
91
92
93
+ @ Test
94
+ public void resourceCachePeriodIsZero () throws Exception {
95
+ this .context = initializeAndRun (WebResourcesConfig .class );
96
+ ResourceProperties properties = this .context .getBean (ResourceProperties .class );
97
+ assertThat (properties .getCachePeriod (), equalTo (0 ));
98
+ }
99
+
92
100
@ Test
93
101
public void liveReloadServer () throws Exception {
94
102
this .context = initializeAndRun (Config .class );
@@ -242,4 +250,9 @@ public LiveReloadServer liveReloadServer() {
242
250
243
251
}
244
252
253
+ @ Configuration
254
+ @ Import ({ LocalDevToolsAutoConfiguration .class , ResourceProperties .class })
255
+ public static class WebResourcesConfig {
256
+
257
+ }
245
258
}
You can’t perform that action at this time.
0 commit comments