Clean up warnings on Hibernate support code
This commit is contained in:
@@ -43,7 +43,6 @@ import static org.mockito.BDDMockito.*;
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.1.2
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public class PersistenceContextTransactionTests {
|
||||
|
||||
private EntityManagerFactory factory;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -54,6 +54,7 @@ public class BeanValidationPostProcessorTests {
|
||||
assertTrue(ex.getRootCause().getMessage().contains("testBean"));
|
||||
assertTrue(ex.getRootCause().getMessage().contains("invalid"));
|
||||
}
|
||||
ac.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,6 +66,7 @@ public class BeanValidationPostProcessorTests {
|
||||
bd.getPropertyValues().add("testBean", new TestBean());
|
||||
ac.registerBeanDefinition("bean", bd);
|
||||
ac.refresh();
|
||||
ac.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,6 +78,7 @@ public class BeanValidationPostProcessorTests {
|
||||
ac.registerBeanDefinition("capp", new RootBeanDefinition(CommonAnnotationBeanPostProcessor.class));
|
||||
ac.registerBeanDefinition("bean", new RootBeanDefinition(AfterInitConstraintBean.class));
|
||||
ac.refresh();
|
||||
ac.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -94,6 +97,7 @@ public class BeanValidationPostProcessorTests {
|
||||
assertTrue(ex.getRootCause().getMessage().contains("stringValue"));
|
||||
assertTrue(ex.getRootCause().getMessage().contains("invalid"));
|
||||
}
|
||||
ac.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -105,6 +109,7 @@ public class BeanValidationPostProcessorTests {
|
||||
bd.getPropertyValues().add("stringValue", "ss");
|
||||
ac.registerBeanDefinition("bean", bd);
|
||||
ac.refresh();
|
||||
ac.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -64,6 +64,7 @@ public class MethodValidationTests {
|
||||
ac.registerSingleton("bean", MyValidBean.class);
|
||||
ac.refresh();
|
||||
doTestProxyValidation(ac.getBean("bean", MyValidInterface.class));
|
||||
ac.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.hibernate.validator.HibernateValidator;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
@@ -179,7 +179,8 @@ public class ValidatorFactoryTests {
|
||||
|
||||
@Test
|
||||
public void testSpringValidationWithAutowiredValidator() throws Exception {
|
||||
ApplicationContext ctx = new AnnotationConfigApplicationContext(LocalValidatorFactoryBean.class);
|
||||
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(
|
||||
LocalValidatorFactoryBean.class);
|
||||
LocalValidatorFactoryBean validator = ctx.getBean(LocalValidatorFactoryBean.class);
|
||||
|
||||
ValidPerson person = new ValidPerson();
|
||||
@@ -194,6 +195,7 @@ public class ValidatorFactoryTests {
|
||||
assertEquals(2, errorCodes.size());
|
||||
assertTrue(errorCodes.contains("NameAddressValid.person"));
|
||||
assertTrue(errorCodes.contains("NameAddressValid"));
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user