Multiply floating store factories for type safety

This commit is contained in:
René Pfeuffer
2018-12-04 08:56:39 +01:00
parent 33f3216164
commit 3021bea65a
23 changed files with 245 additions and 87 deletions

View File

@@ -52,16 +52,16 @@ public abstract class ConfigurationEntryStoreTestBase extends KeyValueStoreTestB
@Override
protected ConfigurationEntryStore getDataStore(Class type) {
return this.createConfigurationStoreFactory()
.withName(storeName)
.withType(type)
.withName(storeName)
.build();
}
@Override
protected ConfigurationEntryStore getDataStore(Class type, Repository repository) {
return this.createConfigurationStoreFactory()
.withName(repoStoreName)
.withType(type)
.withName(repoStoreName)
.forRepository(repository)
.build();
}

View File

@@ -65,13 +65,13 @@ public abstract class DataStoreTestBase extends KeyValueStoreTestBase
// TODO
public void shouldStoreRepositorySpecificData()
{
StoreFactory<DataStore > dataStoreFactory = createDataStoreFactory();
DataStoreFactory dataStoreFactory = createDataStoreFactory();
StoreObject obj = new StoreObject("test-1");
Repository repository = RepositoryTestData.createHeartOfGold();
DataStore<StoreObject> store = dataStoreFactory
.withName("test")
.withType(StoreObject.class)
.withName("test")
.forRepository(repository)
.build();

View File

@@ -66,7 +66,7 @@ public abstract class StoreTestBase extends AbstractTestBase
@Test
public void testGet()
{
ConfigurationStore<StoreObject> store = createStoreFactory().withName("test").withType(StoreObject.class).build();
ConfigurationStore<StoreObject> store = createStoreFactory().withType(StoreObject.class).withName("test").build();
assertNotNull(store);
@@ -82,7 +82,7 @@ public abstract class StoreTestBase extends AbstractTestBase
@Test
public void testSet()
{
ConfigurationStore<StoreObject> store = createStoreFactory().withName("test").withType(StoreObject.class).build();
ConfigurationStore<StoreObject> store = createStoreFactory().withType(StoreObject.class).withName("test").build();
assertNotNull(store);