use of org.springframework.data.repository.core.RepositoryInformation in project spring-cloud-gcp by spring-cloud.
the class SpannerRepositoryFactoryTests method getTargetRepositoryTest.
@Test
public void getTargetRepositoryTest() {
RepositoryInformation repoInfo = mock(RepositoryInformation.class);
// @formatter:off
Mockito.<Class<?>>when(repoInfo.getRepositoryBaseClass()).thenReturn(SimpleSpannerRepository.class);
Mockito.<Class<?>>when(repoInfo.getDomainType()).thenReturn(TestEntity.class);
// @formatter:on
Object repo = this.spannerRepositoryFactory.getTargetRepository(repoInfo);
assertThat(repo).isInstanceOf(SimpleSpannerRepository.class);
}
Aggregations