diff --git a/spring-context/src/test/java/org/springframework/cache/config/CacheAdviceParserTests.java b/spring-context/src/test/java/org/springframework/cache/config/CacheAdviceParserTests.java index 78d8d0b7060..82aa8fb6216 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/CacheAdviceParserTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/CacheAdviceParserTests.java @@ -17,6 +17,7 @@ package org.springframework.cache.config; import org.junit.jupiter.api.Test; + import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.context.support.GenericXmlApplicationContext; @@ -31,8 +32,9 @@ class CacheAdviceParserTests { @Test void keyAndKeyGeneratorCannotBeSetTogether() { - assertThatThrownBy(() -> new GenericXmlApplicationContext("/org/springframework/cache/config/cache-advice-invalid.xml")) - .isInstanceOf(BeanDefinitionStoreException.class); + assertThatThrownBy(() -> new GenericXmlApplicationContext( + "/org/springframework/cache/config/cache-advice-invalid.xml") + ).isInstanceOf(BeanDefinitionStoreException.class); // TODO better exception handling } diff --git a/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java b/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java index c2a350c6cc6..bee527391c2 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java @@ -16,9 +16,13 @@ package org.springframework.cache.config; +import java.io.IOException; +import java.util.Map; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; + import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.interceptor.CacheInterceptor; @@ -32,9 +36,6 @@ import org.springframework.context.testfixture.cache.CacheTestUtils; import org.springframework.context.testfixture.cache.beans.CacheableService; import org.springframework.context.testfixture.cache.beans.DefaultCacheableService; -import java.io.IOException; -import java.util.Map; - import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -115,7 +116,8 @@ class CustomInterceptorTests { protected Object invokeOperation(CacheOperationInvoker invoker) { try { return super.invokeOperation(invoker); - } catch (CacheOperationInvoker.ThrowableWrapper e) { + } + catch (CacheOperationInvoker.ThrowableWrapper e) { Throwable original = e.getOriginal(); if (original.getClass() == UnsupportedOperationException.class) { return 55L; diff --git a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java index 5f3cc893640..9d371d23a18 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java @@ -16,8 +16,11 @@ package org.springframework.cache.config; +import java.util.concurrent.atomic.AtomicLong; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -34,8 +37,6 @@ import org.springframework.context.testfixture.cache.CacheTestUtils; import org.springframework.core.env.Environment; import org.springframework.mock.env.MockEnvironment; -import java.util.concurrent.atomic.AtomicLong; - import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.context.testfixture.cache.CacheTestUtils.assertCacheHit; import static org.springframework.context.testfixture.cache.CacheTestUtils.assertCacheMiss; diff --git a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java index 89ca21fcdfb..3b2c22ebb57 100644 --- a/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java +++ b/spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java @@ -17,6 +17,7 @@ package org.springframework.cache.config; import org.junit.jupiter.api.Test; + import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoUniqueBeanDefinitionException; import org.springframework.cache.CacheManager; @@ -55,9 +56,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ class EnableCachingTests extends AbstractCacheAnnotationTests { - /** - * hook into superclass suite of tests - */ + /** hook into superclass suite of tests */ @Override protected ConfigurableApplicationContext getApplicationContext() { return new AnnotationConfigApplicationContext(EnableCachingConfig.class); @@ -126,9 +125,8 @@ class EnableCachingTests extends AbstractCacheAnnotationTests { void emptyConfigSupport() { ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class); CacheInterceptor ci = context.getBean(CacheInterceptor.class); - assertThat(ci.getCacheResolver()).isInstanceOfSatisfying(SimpleCacheResolver.class, cacheResolver -> { - assertThat(cacheResolver.getCacheManager()).isSameAs(context.getBean(CacheManager.class)); - }); + assertThat(ci.getCacheResolver()).isInstanceOfSatisfying(SimpleCacheResolver.class, cacheResolver -> + assertThat(cacheResolver.getCacheManager()).isSameAs(context.getBean(CacheManager.class))); context.close(); }