DATAKV-153 - Adapt API in KeyValueRepositoryFactoryBean.
Related ticket: DATACMNS-891.
This commit is contained in:
@@ -44,7 +44,8 @@ public class KeyValueRepositoryFactoryBeanUnitTests {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
this.factoryBean = new KeyValueRepositoryFactoryBean<Repository<Object, Serializable>, Object, Serializable>();
|
||||
this.factoryBean = new KeyValueRepositoryFactoryBean<Repository<Object, Serializable>, Object, Serializable>(
|
||||
SampleRepository.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,29 +96,6 @@ public class KeyValueRepositoryFactoryBeanUnitTests {
|
||||
factoryBean.afterPropertiesSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAKV-123
|
||||
* @see DATAKV-112
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initializesConfiguredFactory() {
|
||||
|
||||
Class<? extends AbstractQueryCreator<?, ?>> creatorType = (Class<? extends AbstractQueryCreator<?, ?>>) mock(
|
||||
AbstractQueryCreator.class).getClass();
|
||||
Class<? extends RepositoryQuery> queryType = (Class<? extends RepositoryQuery>) mock(KeyValuePartTreeQuery.class)
|
||||
.getClass();
|
||||
|
||||
factoryBean.setQueryCreator(creatorType);
|
||||
factoryBean.setKeyValueOperations(mock(KeyValueOperations.class));
|
||||
factoryBean.setQueryType(queryType);
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
exception.expectMessage("Repository interface");
|
||||
|
||||
factoryBean.afterPropertiesSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAKV-123
|
||||
*/
|
||||
@@ -144,4 +122,6 @@ public class KeyValueRepositoryFactoryBeanUnitTests {
|
||||
public void rejectsNullQueryType() {
|
||||
factoryBean.setQueryType(null);
|
||||
}
|
||||
|
||||
interface SampleRepository extends Repository<Object, Serializable> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user