DATACMNS-1255 - Polishing.
Introduce create(…) method as utility that centralizes code that would live in the modules otherwise. This method is a shortcut that creates the repository factory using Supplier, configures the factory with CdiRepositoryConfiguration settings, collects repository fragments and creates the actual repository implementation. Related pull request: #272.
This commit is contained in:
@@ -76,9 +76,8 @@ public class DummyCdiExtension extends CdiRepositoryExtensionSupport {
|
||||
protected T create(CreationalContext<T> creationalContext, Class<T> repositoryType) {
|
||||
|
||||
T mock = Mockito.mock(repositoryType);
|
||||
DummyRepositoryFactory repositoryFactory = new DummyRepositoryFactory(mock);
|
||||
|
||||
return create(repositoryFactory, repositoryType, getRepositoryFragments(repositoryType));
|
||||
return create(() -> new DummyRepositoryFactory(mock), repositoryType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user