Clean up warnings

This commit is contained in:
Sam Brannen
2019-10-30 19:14:58 +01:00
parent 3c17178b16
commit 9f00eb68e9
19 changed files with 20 additions and 13 deletions

View File

@@ -95,7 +95,7 @@ public class MethodLocatingFactoryBeanTests {
}
@Test
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testSunnyDayPath() throws Exception {
given(beanFactory.getType(BEAN_NAME)).willReturn((Class)String.class);
factory.setTargetBeanName(BEAN_NAME);
@@ -110,7 +110,7 @@ public class MethodLocatingFactoryBeanTests {
}
@Test
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testWhereMethodCannotBeResolved() {
given(beanFactory.getType(BEAN_NAME)).willReturn((Class)String.class);
factory.setTargetBeanName(BEAN_NAME);

View File

@@ -1356,6 +1356,7 @@ public class ConfigurationClassPostProcessorTests {
@Configuration
public static class RawFactoryMethodRepositoryConfiguration {
@SuppressWarnings("rawtypes") // intentionally a raw type
@Bean
public Repository stringRepo() {
return new Repository<String>() {

View File

@@ -305,6 +305,7 @@ public class PropertySourceAnnotationTests {
@Inject Environment env;
@SuppressWarnings("rawtypes")
@Bean
public FactoryBean testBean() {
final String name = env.getProperty("testbean.name");

View File

@@ -578,6 +578,7 @@ public class ApplicationContextEventTests extends AbstractApplicationEventListen
}
@SuppressWarnings("rawtypes")
public static class MyPayloadListener implements ApplicationListener<PayloadApplicationEvent> {
public final Set<Object> seenPayloads = new HashSet<>();

View File

@@ -34,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class PayloadApplicationEventTests {
@Test
@SuppressWarnings({ "rawtypes", "resource" })
public void testEventClassWithInterface() {
ApplicationContext ac = new AnnotationConfigApplicationContext(AuditableListener.class);
AuditablePayloadEvent event = new AuditablePayloadEvent<>(this, "xyz");