DATAJPA-308 - Improved test case to satisfy Java 6 compiler.
Added explicit type hints to matchers as the code won't compile under JDK 6 otherwise.
This commit is contained in:
@@ -20,6 +20,7 @@ import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
@@ -43,6 +44,10 @@ import org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcesso
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class JpaRepositoryConfigExtensionUnitTests {
|
||||
|
||||
private static final String RIABPP_CLASS_NAME = "org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor";
|
||||
private static final String PETPP_CLASS_NAME = "org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor";
|
||||
private static final String PABPP_CLASS_NAME = "org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor";
|
||||
|
||||
@Mock
|
||||
RepositoryConfigurationSource configSource;
|
||||
|
||||
@@ -59,12 +64,9 @@ public class JpaRepositoryConfigExtensionUnitTests {
|
||||
|
||||
Iterable<String> names = Arrays.asList(factory.getBeanDefinitionNames());
|
||||
|
||||
assertThat(names, hasItem(startsWith("org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor")));
|
||||
assertThat(names,
|
||||
hasItem(startsWith("org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor")));
|
||||
assertThat(
|
||||
names,
|
||||
hasItem(startsWith("org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor")));
|
||||
assertThat(names, Matchers.<String> hasItem(startsWith(PABPP_CLASS_NAME)));
|
||||
assertThat(names, Matchers.<String> hasItem(startsWith(PETPP_CLASS_NAME)));
|
||||
assertThat(names, Matchers.<String> hasItem(startsWith(RIABPP_CLASS_NAME)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user