mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Make type optional
This commit is contained in:
@@ -65,10 +65,10 @@ public class XmlGroupDAO extends AbstractXmlDAO<Group, XmlGroupDatabase>
|
||||
*/
|
||||
@Inject
|
||||
public XmlGroupDAO(ConfigurationStoreFactory storeFactory) {
|
||||
super(storeFactory.
|
||||
forType(XmlGroupDatabase.class)
|
||||
.withName(STORE_NAME)
|
||||
.build());
|
||||
super(storeFactory
|
||||
.withName(STORE_NAME)
|
||||
.withType(XmlGroupDatabase.class)
|
||||
.build());
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -64,9 +64,10 @@ public class XmlUserDAO extends AbstractXmlDAO<User, XmlUserDatabase>
|
||||
@Inject
|
||||
public XmlUserDAO(ConfigurationStoreFactory storeFactory)
|
||||
{
|
||||
super(storeFactory.forType(XmlUserDatabase.class)
|
||||
.withName(STORE_NAME)
|
||||
.build());
|
||||
super(storeFactory
|
||||
.withName(STORE_NAME)
|
||||
.withType(XmlUserDatabase.class)
|
||||
.build());
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -65,11 +65,11 @@ public class FileBlobStoreTest extends BlobStoreTestBase
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void shouldStoreAndLoadInRepository() {
|
||||
BlobStore store = createBlobStoreFactory().
|
||||
forType(StoreObject.class)
|
||||
.withName("test")
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build();
|
||||
BlobStore store = createBlobStoreFactory()
|
||||
.withName("test")
|
||||
.withType(StoreObject.class)
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build();
|
||||
|
||||
Blob createdBlob = store.create("abc");
|
||||
List<Blob> storedBlobs = store.getAll();
|
||||
@@ -78,6 +78,6 @@ public class FileBlobStoreTest extends BlobStoreTestBase
|
||||
assertThat(storedBlobs)
|
||||
.isNotNull()
|
||||
.hasSize(1)
|
||||
.usingElementComparatorOnFields("id").containsExactly(createdBlob);
|
||||
.usingElementComparatorOnFields("id").containsExactly(createdBlob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,10 +132,10 @@ public class JAXBConfigurationEntryStoreTest
|
||||
ConfigurationEntryStore<AssignedPermission> store = createPermissionStore(RESOURCE_FIXED, name);
|
||||
|
||||
store.put("a45", new AssignedPermission("tuser4", "repository:create"));
|
||||
store = createConfigurationStoreFactory().
|
||||
forType(AssignedPermission.class)
|
||||
.withName(name)
|
||||
.build();
|
||||
store = createConfigurationStoreFactory()
|
||||
.withName(name)
|
||||
.withType(AssignedPermission.class)
|
||||
.build();
|
||||
|
||||
AssignedPermission ap = store.get("a45");
|
||||
|
||||
@@ -231,9 +231,9 @@ public class JAXBConfigurationEntryStoreTest
|
||||
}
|
||||
|
||||
copy(resource, name);
|
||||
return createConfigurationStoreFactory().
|
||||
forType(AssignedPermission.class)
|
||||
.withName(name)
|
||||
.build();
|
||||
return createConfigurationStoreFactory()
|
||||
.withName(name)
|
||||
.withType(AssignedPermission.class)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ public class JAXBConfigurationStoreTest extends StoreTestBase {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void shouldStoreAndLoadInRepository()
|
||||
{
|
||||
ConfigurationStore<StoreObject> store = createStoreFactory().
|
||||
forType(StoreObject.class)
|
||||
.withName("test")
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build();
|
||||
ConfigurationStore<StoreObject> store = createStoreFactory()
|
||||
.withName("test")
|
||||
.withType(StoreObject.class)
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build();
|
||||
|
||||
store.set(new StoreObject("value"));
|
||||
StoreObject storeObject = store.get();
|
||||
|
||||
@@ -61,16 +61,18 @@ public class JAXBDataStoreTest extends DataStoreTestBase {
|
||||
|
||||
@Override
|
||||
protected DataStore getDataStore(Class type, Repository repository) {
|
||||
return createDataStoreFactory().forType(type)
|
||||
return createDataStoreFactory()
|
||||
.withName("test")
|
||||
.withType(type)
|
||||
.forRepository(repository)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DataStore getDataStore(Class type) {
|
||||
return createDataStoreFactory().forType(type)
|
||||
return createDataStoreFactory()
|
||||
.withName("test")
|
||||
.withType(type)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user