Stop resolving CachingConfigurer instances eagerly

Closes gh-27751
This commit is contained in:
Stephane Nicoll
2021-12-14 09:45:24 +01:00
parent 4c2e0ee5ff
commit c7642422c3
4 changed files with 68 additions and 39 deletions

View File

@@ -18,7 +18,6 @@ package org.springframework.cache.config;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
import org.springframework.cache.CacheManager;
@@ -107,11 +106,8 @@ public class EnableCachingTests extends AbstractCacheAnnotationTests {
try {
ctx.refresh();
}
catch (BeanCreationException ex) {
Throwable root = ex.getRootCause();
boolean condition = root instanceof IllegalStateException;
assertThat(condition).isTrue();
assertThat(root.getMessage().contains("implementations of CachingConfigurer")).isTrue();
catch (IllegalStateException ex) {
assertThat(ex.getMessage().contains("implementations of CachingConfigurer")).isTrue();
}
}