Skip to content

Commit a2c5a79

Browse files
committed
Merge pull request #16325 from izeye
* pr/16325: Restore setExtractBareNamePropertyMethods() for AssertJ
2 parents a2d37dc + 038e213 commit a2c5a79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,23 +413,25 @@ public void multipleWebFluxRegistrations() {
413413

414414
@Test
415415
public void cachePeriod() {
416+
Assertions.setExtractBareNamePropertyMethods(false);
416417
this.contextRunner.withPropertyValues("spring.resources.cache.period:5")
417418
.run((context) -> {
418419
Map<PathPattern, Object> handlerMap = getHandlerMap(context);
419420
assertThat(handlerMap).hasSize(2);
420421
for (Object handler : handlerMap.values()) {
421422
if (handler instanceof ResourceWebHandler) {
422-
Assertions.setExtractBareNamePropertyMethods(false);
423423
assertThat(((ResourceWebHandler) handler).getCacheControl())
424424
.isEqualToComparingFieldByField(
425425
CacheControl.maxAge(5, TimeUnit.SECONDS));
426426
}
427427
}
428428
});
429+
Assertions.setExtractBareNamePropertyMethods(true);
429430
}
430431

431432
@Test
432433
public void cacheControl() {
434+
Assertions.setExtractBareNamePropertyMethods(false);
433435
this.contextRunner
434436
.withPropertyValues("spring.resources.cache.cachecontrol.max-age:5",
435437
"spring.resources.cache.cachecontrol.proxy-revalidate:true")
@@ -438,14 +440,14 @@ public void cacheControl() {
438440
assertThat(handlerMap).hasSize(2);
439441
for (Object handler : handlerMap.values()) {
440442
if (handler instanceof ResourceWebHandler) {
441-
Assertions.setExtractBareNamePropertyMethods(false);
442443
assertThat(((ResourceWebHandler) handler).getCacheControl())
443444
.isEqualToComparingFieldByField(
444445
CacheControl.maxAge(5, TimeUnit.SECONDS)
445446
.proxyRevalidate());
446447
}
447448
}
448449
});
450+
Assertions.setExtractBareNamePropertyMethods(true);
449451
}
450452

451453
private Map<PathPattern, Object> getHandlerMap(ApplicationContext context) {

0 commit comments

Comments
 (0)