Clean up warnings
This commit is contained in:
@@ -97,7 +97,7 @@ public class JCacheCacheManagerTests extends AbstractTransactionSupportingCacheM
|
||||
return cacheManager;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addCache(String name) {
|
||||
cacheNames.add(name);
|
||||
Cache cache = mock(Cache.class);
|
||||
|
||||
@@ -74,6 +74,7 @@ public class JCacheJavaConfigTests extends AbstractJCacheAnnotationTests {
|
||||
cos.getExceptionCacheResolver());
|
||||
JCacheInterceptor interceptor = context.getBean(JCacheInterceptor.class);
|
||||
assertSame(context.getBean("errorHandler", CacheErrorHandler.class), interceptor.getErrorHandler());
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -59,6 +59,7 @@ public class CacheResolverAdapterTests extends AbstractJCacheTests {
|
||||
adapter.resolveCaches(dummyContext));
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected CacheResolver getCacheResolver(CacheInvocationContext<? extends Annotation> context, String cacheName) {
|
||||
CacheResolver cacheResolver = mock(CacheResolver.class);
|
||||
javax.cache.Cache cache;
|
||||
|
||||
@@ -66,6 +66,7 @@ public class JCacheErrorHandlerTests {
|
||||
this.errorCache = context.getBean("mockErrorCache", Cache.class);
|
||||
this.errorHandler = context.getBean(CacheErrorHandler.class);
|
||||
this.simpleService = context.getBean(SimpleService.class);
|
||||
context.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class JCacheKeyGeneratorTests {
|
||||
@@ -60,6 +59,7 @@ public class JCacheKeyGeneratorTests {
|
||||
this.keyGenerator = context.getBean(TestKeyGenerator.class);
|
||||
this.simpleService = context.getBean(SimpleService.class);
|
||||
this.cache = context.getBean(CacheManager.class).getCache("test");
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -32,6 +32,7 @@ public class TestableCacheResolver implements CacheResolver {
|
||||
@Override
|
||||
public <K, V> Cache<K, V> resolveCache(CacheInvocationContext<? extends Annotation> cacheInvocationContext) {
|
||||
String cacheName = cacheInvocationContext.getCacheName();
|
||||
@SuppressWarnings("unchecked")
|
||||
Cache<K, V> mock = mock(Cache.class);
|
||||
given(mock.getName()).willReturn(cacheName);
|
||||
return mock;
|
||||
|
||||
@@ -63,9 +63,11 @@ import static org.junit.Assert.fail;
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
public class ValidatorFactoryTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("cast")
|
||||
public void testSimpleValidation() {
|
||||
LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
|
||||
validator.afterPropertiesSet();
|
||||
@@ -92,6 +94,7 @@ public class ValidatorFactoryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("cast")
|
||||
public void testSimpleValidationWithCustomProvider() {
|
||||
LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
|
||||
validator.setProviderClass(HibernateValidator.class);
|
||||
|
||||
Reference in New Issue
Block a user