mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Do no longer expose StoreParameters
This commit is contained in:
@@ -43,8 +43,6 @@ import sonia.scm.xml.AbstractXmlDAO;
|
||||
|
||||
import sonia.scm.store.ConfigurationStoreFactory;
|
||||
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -67,10 +65,10 @@ public class XmlGroupDAO extends AbstractXmlDAO<Group, XmlGroupDatabase>
|
||||
*/
|
||||
@Inject
|
||||
public XmlGroupDAO(ConfigurationStoreFactory storeFactory) {
|
||||
super(storeFactory.getStore(
|
||||
super(storeFactory.
|
||||
forType(XmlGroupDatabase.class)
|
||||
.withName(STORE_NAME)
|
||||
.build()));
|
||||
.build());
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -41,8 +41,6 @@ import sonia.scm.user.User;
|
||||
import sonia.scm.user.UserDAO;
|
||||
import sonia.scm.xml.AbstractXmlDAO;
|
||||
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -66,10 +64,9 @@ public class XmlUserDAO extends AbstractXmlDAO<User, XmlUserDatabase>
|
||||
@Inject
|
||||
public XmlUserDAO(ConfigurationStoreFactory storeFactory)
|
||||
{
|
||||
super(storeFactory.getStore(
|
||||
forType(XmlUserDatabase.class)
|
||||
super(storeFactory.forType(XmlUserDatabase.class)
|
||||
.withName(STORE_NAME)
|
||||
.build()));
|
||||
.build());
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -42,7 +42,6 @@ import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -66,11 +65,11 @@ public class FileBlobStoreTest extends BlobStoreTestBase
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void shouldStoreAndLoadInRepository() {
|
||||
BlobStore store = createBlobStoreFactory().getStore(
|
||||
BlobStore store = createBlobStoreFactory().
|
||||
forType(StoreObject.class)
|
||||
.withName("test")
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build());
|
||||
.build();
|
||||
|
||||
Blob createdBlob = store.create("abc");
|
||||
List<Blob> storedBlobs = store.getAll();
|
||||
|
||||
@@ -50,7 +50,6 @@ import java.util.UUID;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -133,10 +132,10 @@ public class JAXBConfigurationEntryStoreTest
|
||||
ConfigurationEntryStore<AssignedPermission> store = createPermissionStore(RESOURCE_FIXED, name);
|
||||
|
||||
store.put("a45", new AssignedPermission("tuser4", "repository:create"));
|
||||
store = createConfigurationStoreFactory().getStore(
|
||||
store = createConfigurationStoreFactory().
|
||||
forType(AssignedPermission.class)
|
||||
.withName(name)
|
||||
.build());
|
||||
.build();
|
||||
|
||||
AssignedPermission ap = store.get("a45");
|
||||
|
||||
@@ -232,9 +231,9 @@ public class JAXBConfigurationEntryStoreTest
|
||||
}
|
||||
|
||||
copy(resource, name);
|
||||
return createConfigurationStoreFactory().getStore(
|
||||
return createConfigurationStoreFactory().
|
||||
forType(AssignedPermission.class)
|
||||
.withName(name)
|
||||
.build());
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,11 +35,8 @@ package sonia.scm.store;
|
||||
import org.junit.Test;
|
||||
import sonia.scm.repository.Repository;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link JAXBConfigurationStore}.
|
||||
@@ -57,13 +54,13 @@ public class JAXBConfigurationStoreTest extends StoreTestBase {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void shouldStoreAndLoadInRepository() throws IOException
|
||||
public void shouldStoreAndLoadInRepository()
|
||||
{
|
||||
ConfigurationStore<StoreObject> store = createStoreFactory().getStore(
|
||||
ConfigurationStore<StoreObject> store = createStoreFactory().
|
||||
forType(StoreObject.class)
|
||||
.withName("test")
|
||||
.forRepository(new Repository("id", "git", "ns", "n"))
|
||||
.build());
|
||||
.build();
|
||||
|
||||
store.set(new StoreObject("value"));
|
||||
StoreObject storeObject = store.get();
|
||||
|
||||
@@ -40,7 +40,6 @@ import sonia.scm.security.UUIDKeyGenerator;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -62,17 +61,17 @@ public class JAXBDataStoreTest extends DataStoreTestBase {
|
||||
|
||||
@Override
|
||||
protected DataStore getDataStore(Class type, Repository repository) {
|
||||
return createDataStoreFactory().getStore(forType(type)
|
||||
return createDataStoreFactory().forType(type)
|
||||
.withName("test")
|
||||
.forRepository(repository)
|
||||
.build());
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DataStore getDataStore(Class type) {
|
||||
return createDataStoreFactory().getStore(forType(type)
|
||||
return createDataStoreFactory().forType(type)
|
||||
.withName("test")
|
||||
.build());
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user