diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java index ae2c7139d8..576c7ef2ef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java @@ -413,23 +413,25 @@ public class WebFluxAutoConfigurationTests { @Test public void cachePeriod() { + Assertions.setExtractBareNamePropertyMethods(false); this.contextRunner.withPropertyValues("spring.resources.cache.period:5") .run((context) -> { Map handlerMap = getHandlerMap(context); assertThat(handlerMap).hasSize(2); for (Object handler : handlerMap.values()) { if (handler instanceof ResourceWebHandler) { - Assertions.setExtractBareNamePropertyMethods(false); assertThat(((ResourceWebHandler) handler).getCacheControl()) .isEqualToComparingFieldByField( CacheControl.maxAge(5, TimeUnit.SECONDS)); } } }); + Assertions.setExtractBareNamePropertyMethods(true); } @Test public void cacheControl() { + Assertions.setExtractBareNamePropertyMethods(false); this.contextRunner .withPropertyValues("spring.resources.cache.cachecontrol.max-age:5", "spring.resources.cache.cachecontrol.proxy-revalidate:true") @@ -438,7 +440,6 @@ public class WebFluxAutoConfigurationTests { assertThat(handlerMap).hasSize(2); for (Object handler : handlerMap.values()) { if (handler instanceof ResourceWebHandler) { - Assertions.setExtractBareNamePropertyMethods(false); assertThat(((ResourceWebHandler) handler).getCacheControl()) .isEqualToComparingFieldByField( CacheControl.maxAge(5, TimeUnit.SECONDS) @@ -446,6 +447,7 @@ public class WebFluxAutoConfigurationTests { } } }); + Assertions.setExtractBareNamePropertyMethods(true); } private Map getHandlerMap(ApplicationContext context) {