From 36cbd008532afe8adac54f30cccf7210b2b415fc Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 6 Mar 2019 19:42:38 +0000 Subject: [PATCH] Disable AssertJ's bare-named property accessor discovery AssertJ includes a change in 3.12 that means that, by default, it now incorrectly identifies some of the builder methods on CacheControl as accessor methods for its fields. This commit restores the behaviour of 3.11 so that a method is only considered to be a property accessor if a matches the Java bean naming conventions. Closes gh-16145 --- .../web/reactive/WebFluxAutoConfigurationTests.java | 3 +++ 1 file changed, 3 insertions(+) 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 6118c5b7e6b..63d3c8676c5 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 @@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; import javax.validation.ValidatorFactory; +import org.assertj.core.api.Assertions; import org.joda.time.DateTime; import org.junit.Test; @@ -418,6 +419,7 @@ 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)); @@ -436,6 +438,7 @@ 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)