use of org.springframework.data.repository.config.CustomRepositoryImplementationDetector in project spring-data-commons by spring-projects.
the class CdiRepositoryBeanUnitTests method passesCorrectBeanNameToTheImplementationDetector.
// DATACMNS-764
@Test
public void passesCorrectBeanNameToTheImplementationDetector() {
CustomRepositoryImplementationDetector detector = mock(CustomRepositoryImplementationDetector.class);
CdiRepositoryBean<SampleRepository> bean = new //
CdiRepositoryBean<SampleRepository>(//
SINGLE_ANNOTATION, //
SampleRepository.class, //
beanManager, //
Optional.of(detector)) {
@Override
protected //
SampleRepository create(//
CreationalContext<SampleRepository> creationalContext, //
Class<SampleRepository> repositoryType, //
Optional<Object> customImplementation) {
return null;
}
};
bean.create(mock(CreationalContext.class), SampleRepository.class);
//
verify(detector).detectCustomImplementation(//
eq("CdiRepositoryBeanUnitTests.SampleRepositoryImpl"), //
eq("CdiRepositoryBeanUnitTests.SampleRepositoryImpl"), //
anySet(), //
anySet(), //
Mockito.any(Function.class));
}
Aggregations