Skip to content

Commit 36cbd00

Browse files
committed
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
1 parent e667911 commit 36cbd00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import javax.validation.ValidatorFactory;
2626

27+
import org.assertj.core.api.Assertions;
2728
import org.joda.time.DateTime;
2829
import org.junit.Test;
2930

@@ -418,6 +419,7 @@ public void cachePeriod() {
418419
assertThat(handlerMap).hasSize(2);
419420
for (Object handler : handlerMap.values()) {
420421
if (handler instanceof ResourceWebHandler) {
422+
Assertions.setExtractBareNamePropertyMethods(false);
421423
assertThat(((ResourceWebHandler) handler).getCacheControl())
422424
.isEqualToComparingFieldByField(
423425
CacheControl.maxAge(5, TimeUnit.SECONDS));
@@ -436,6 +438,7 @@ public void cacheControl() {
436438
assertThat(handlerMap).hasSize(2);
437439
for (Object handler : handlerMap.values()) {
438440
if (handler instanceof ResourceWebHandler) {
441+
Assertions.setExtractBareNamePropertyMethods(false);
439442
assertThat(((ResourceWebHandler) handler).getCacheControl())
440443
.isEqualToComparingFieldByField(
441444
CacheControl.maxAge(5, TimeUnit.SECONDS)

0 commit comments

Comments
 (0)