File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed
spring-context/src/test/java/org/springframework/cache/config Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 17
17
package org .springframework .cache .config ;
18
18
19
19
import org .junit .jupiter .api .Test ;
20
+
20
21
import org .springframework .beans .factory .BeanDefinitionStoreException ;
21
22
import org .springframework .context .support .GenericXmlApplicationContext ;
22
23
@@ -31,8 +32,9 @@ class CacheAdviceParserTests {
31
32
32
33
@ Test
33
34
void keyAndKeyGeneratorCannotBeSetTogether () {
34
- assertThatThrownBy (() -> new GenericXmlApplicationContext ("/org/springframework/cache/config/cache-advice-invalid.xml" ))
35
- .isInstanceOf (BeanDefinitionStoreException .class );
35
+ assertThatThrownBy (() -> new GenericXmlApplicationContext (
36
+ "/org/springframework/cache/config/cache-advice-invalid.xml" )
37
+ ).isInstanceOf (BeanDefinitionStoreException .class );
36
38
// TODO better exception handling
37
39
}
38
40
Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .cache .config ;
18
18
19
+ import java .io .IOException ;
20
+ import java .util .Map ;
21
+
19
22
import org .junit .jupiter .api .AfterEach ;
20
23
import org .junit .jupiter .api .BeforeEach ;
21
24
import org .junit .jupiter .api .Test ;
25
+
22
26
import org .springframework .cache .CacheManager ;
23
27
import org .springframework .cache .annotation .EnableCaching ;
24
28
import org .springframework .cache .interceptor .CacheInterceptor ;
32
36
import org .springframework .context .testfixture .cache .beans .CacheableService ;
33
37
import org .springframework .context .testfixture .cache .beans .DefaultCacheableService ;
34
38
35
- import java .io .IOException ;
36
- import java .util .Map ;
37
-
38
39
import static org .assertj .core .api .Assertions .assertThat ;
39
40
import static org .assertj .core .api .Assertions .assertThatThrownBy ;
40
41
@@ -115,7 +116,8 @@ static class TestCacheInterceptor extends CacheInterceptor {
115
116
protected Object invokeOperation (CacheOperationInvoker invoker ) {
116
117
try {
117
118
return super .invokeOperation (invoker );
118
- } catch (CacheOperationInvoker .ThrowableWrapper e ) {
119
+ }
120
+ catch (CacheOperationInvoker .ThrowableWrapper e ) {
119
121
Throwable original = e .getOriginal ();
120
122
if (original .getClass () == UnsupportedOperationException .class ) {
121
123
return 55L ;
Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .cache .config ;
18
18
19
+ import java .util .concurrent .atomic .AtomicLong ;
20
+
19
21
import org .junit .jupiter .api .AfterEach ;
20
22
import org .junit .jupiter .api .Test ;
23
+
21
24
import org .springframework .beans .factory .annotation .Autowired ;
22
25
import org .springframework .cache .Cache ;
23
26
import org .springframework .cache .CacheManager ;
34
37
import org .springframework .core .env .Environment ;
35
38
import org .springframework .mock .env .MockEnvironment ;
36
39
37
- import java .util .concurrent .atomic .AtomicLong ;
38
-
39
40
import static org .assertj .core .api .Assertions .assertThat ;
40
41
import static org .springframework .context .testfixture .cache .CacheTestUtils .assertCacheHit ;
41
42
import static org .springframework .context .testfixture .cache .CacheTestUtils .assertCacheMiss ;
Original file line number Diff line number Diff line change 17
17
package org .springframework .cache .config ;
18
18
19
19
import org .junit .jupiter .api .Test ;
20
+
20
21
import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
21
22
import org .springframework .beans .factory .NoUniqueBeanDefinitionException ;
22
23
import org .springframework .cache .CacheManager ;
55
56
*/
56
57
class EnableCachingTests extends AbstractCacheAnnotationTests {
57
58
58
- /**
59
- * hook into superclass suite of tests
60
- */
59
+ /** hook into superclass suite of tests */
61
60
@ Override
62
61
protected ConfigurableApplicationContext getApplicationContext () {
63
62
return new AnnotationConfigApplicationContext (EnableCachingConfig .class );
@@ -126,9 +125,8 @@ void noCacheManagerBeans() {
126
125
void emptyConfigSupport () {
127
126
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext (EmptyConfigSupportConfig .class );
128
127
CacheInterceptor ci = context .getBean (CacheInterceptor .class );
129
- assertThat (ci .getCacheResolver ()).isInstanceOfSatisfying (SimpleCacheResolver .class , cacheResolver -> {
130
- assertThat (cacheResolver .getCacheManager ()).isSameAs (context .getBean (CacheManager .class ));
131
- });
128
+ assertThat (ci .getCacheResolver ()).isInstanceOfSatisfying (SimpleCacheResolver .class , cacheResolver ->
129
+ assertThat (cacheResolver .getCacheManager ()).isSameAs (context .getBean (CacheManager .class )));
132
130
context .close ();
133
131
}
134
132
You can’t perform that action at this time.
0 commit comments