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:
Mark Paluch
2018-03-12 14:58:48 +01:00
parent 0f174f6867
commit 60d5426c7e
2 changed files with 34 additions and 7 deletions

View File

@@ -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);
}
}