From 038e21334375f74de3987f9544ff1e3d9f7cca1b Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 26 Mar 2019 21:53:28 +0900 Subject: [PATCH] Restore setExtractBareNamePropertyMethods() for AssertJ Closes gh-16325 --- .../web/reactive/WebFluxAutoConfigurationTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {