Fix 'is already an instance of type' warnings
This commit is contained in:
@@ -33,6 +33,7 @@ import org.springframework.core.convert.converter.GenericConverter;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
@@ -136,8 +137,8 @@ public class ConversionServiceFactoryBeanTests {
|
||||
|
||||
public ComplexConstructorArgument(Map<String, Class<?>> map) {
|
||||
assertTrue(!map.isEmpty());
|
||||
assertTrue(map.keySet().iterator().next() instanceof String);
|
||||
assertTrue(map.values().iterator().next() instanceof Class);
|
||||
assertThat(map.keySet().iterator().next(), instanceOf(String.class));
|
||||
assertThat(map.values().iterator().next(), instanceOf(Class.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.scheduling.timer;
|
||||
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
@@ -84,7 +87,7 @@ public class TimerSupportTests extends TestCase {
|
||||
try {
|
||||
timerFactoryBean.setScheduledTimerTasks(tasks);
|
||||
timerFactoryBean.afterPropertiesSet();
|
||||
assertTrue(timerFactoryBean.getObject() instanceof Timer);
|
||||
assertThat(timerFactoryBean.getObject(), instanceOf(Timer.class));
|
||||
timerTask0.run();
|
||||
timerTask1.run();
|
||||
timerTask2.run();
|
||||
|
||||
Reference in New Issue
Block a user