Skip to content

Commit 11ed265

Browse files
committed
Polish
1 parent 15c3cdd commit 11ed265

17 files changed

+265
-268
lines changed

spring-context/src/test/java/org/springframework/cache/CacheReproTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.cache;
1818

19-
import java.util.Arrays;
2019
import java.util.Collection;
2120
import java.util.Collections;
2221
import java.util.List;
@@ -128,8 +127,8 @@ public void spr13081ConfigFailIfCacheResolverReturnsNullCacheName() {
128127
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Spr13081Config.class);
129128
Spr13081Service bean = context.getBean(Spr13081Service.class);
130129

131-
thrown.expect(IllegalStateException.class);
132-
thrown.expectMessage(MyCacheResolver.class.getName());
130+
this.thrown.expect(IllegalStateException.class);
131+
this.thrown.expectMessage(MyCacheResolver.class.getName());
133132
bean.getSimple(null);
134133
}
135134

@@ -235,7 +234,7 @@ public static class Spr11592Config {
235234
@Bean
236235
public CacheManager cacheManager() {
237236
SimpleCacheManager cacheManager = new SimpleCacheManager();
238-
cacheManager.setCaches(Arrays.asList(cache()));
237+
cacheManager.setCaches(Collections.singletonList(cache()));
239238
return cacheManager;
240239
}
241240

spring-context/src/test/java/org/springframework/cache/annotation/AnnotationCacheOperationSourceTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void caching() throws Exception {
7575

7676
@Test
7777
public void emptyCaching() throws Exception {
78-
Collection<CacheOperation> ops = getOps(AnnotatedClass.class, "emptyCaching", 0);
78+
getOps(AnnotatedClass.class, "emptyCaching", 0);
7979
}
8080

8181
@Test
@@ -155,7 +155,7 @@ public void customKeyGeneratorInherited() {
155155

156156
@Test
157157
public void keyAndKeyGeneratorCannotBeSetTogether() {
158-
exception.expect(IllegalStateException.class);
158+
this.exception.expect(IllegalStateException.class);
159159
getOps(AnnotatedClass.class, "invalidKeyAndKeyGeneratorSet");
160160
}
161161

@@ -189,7 +189,7 @@ public void customCacheResolverInherited() {
189189

190190
@Test
191191
public void cacheResolverAndCacheManagerCannotBeSetTogether() {
192-
exception.expect(IllegalStateException.class);
192+
this.exception.expect(IllegalStateException.class);
193193
getOps(AnnotatedClass.class, "invalidCacheResolverAndCacheManagerSet");
194194
}
195195

@@ -275,7 +275,7 @@ private Collection<CacheOperation> getOps(Class<?> target, String name, int expe
275275
private Collection<CacheOperation> getOps(Class<?> target, String name) {
276276
try {
277277
Method method = target.getMethod(name);
278-
return source.getCacheOperations(method, target);
278+
return this.source.getCacheOperations(method, target);
279279
}
280280
catch (NoSuchMethodException ex) {
281281
throw new IllegalStateException(ex);

0 commit comments

Comments
 (0)