mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 13:35:44 +01:00
Do no longer expose StoreParameters
This commit is contained in:
@@ -38,8 +38,6 @@ import sonia.scm.repository.Repository;
|
||||
import sonia.scm.store.BlobStore;
|
||||
import sonia.scm.store.BlobStoreFactory;
|
||||
|
||||
import static sonia.scm.store.StoreParameters.forType;
|
||||
|
||||
/**
|
||||
* Creates {@link BlobStore} objects to store lfs objects.
|
||||
*
|
||||
@@ -78,11 +76,9 @@ public class LfsBlobStoreFactory {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public BlobStore getLfsBlobStore(Repository repository) {
|
||||
return blobStoreFactory.getStore(
|
||||
forType(String.class)
|
||||
return blobStoreFactory.forType(String.class)
|
||||
.withName(repository.getId() + GIT_LFS_REPOSITORY_POSTFIX)
|
||||
.forRepository(repository)
|
||||
.build()
|
||||
);
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ package sonia.scm.repository;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -44,6 +45,8 @@ import java.io.File;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -81,6 +84,10 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
assertTrue(refs.isDirectory());
|
||||
}
|
||||
|
||||
@Before
|
||||
public void initFactory() {
|
||||
when(factory.forType(any())).thenCallRealMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory,
|
||||
|
||||
@@ -41,9 +41,11 @@ import sonia.scm.repository.Repository;
|
||||
import sonia.scm.store.BlobStoreFactory;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link LfsBlobStoreFactory}.
|
||||
@@ -61,6 +63,7 @@ public class LfsBlobStoreFactoryTest {
|
||||
|
||||
@Test
|
||||
public void getBlobStore() {
|
||||
when(blobStoreFactory.forType(any())).thenCallRealMethod();
|
||||
Repository repository = new Repository("the-id", "GIT", "space", "the-name");
|
||||
lfsBlobStoreFactory.getLfsBlobStore(repository);
|
||||
|
||||
@@ -73,7 +76,7 @@ public class LfsBlobStoreFactoryTest {
|
||||
}));
|
||||
|
||||
// make sure there have been no further usages of the factory
|
||||
verifyNoMoreInteractions(blobStoreFactory);
|
||||
verify(blobStoreFactory, times(1)).getStore(any());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user