mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
Remove dead code
This commit is contained in:
@@ -153,7 +153,10 @@ public class XmlRepositoryDAO
|
||||
return context
|
||||
.getBaseDirectory()
|
||||
.toPath()
|
||||
.resolve(findExistingRepositoryPath(repository).map(RepositoryPath::getPath).orElse(initialRepositoryLocationResolver.getRelativeRepositoryPath(repository)));
|
||||
.resolve(
|
||||
findExistingRepositoryPath(repository)
|
||||
.map(RepositoryPath::getPath)
|
||||
.orElseThrow(() -> new InternalRepositoryException(repository, "could not find base directory for repository")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,19 +104,6 @@ public class XmlRepositoryDAOTest {
|
||||
assertThat(path.toString()).isEqualTo("/tmp/path");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldGetPathForNewRepository() {
|
||||
when(db.getPaths()).thenReturn(emptyList());
|
||||
|
||||
InitialRepositoryLocationResolver initialRepositoryLocationResolver = new InitialRepositoryLocationResolver(context);
|
||||
XmlRepositoryDAO dao = new XmlRepositoryDAO(storeFactory, initialRepositoryLocationResolver, context);
|
||||
|
||||
Repository newRepository = new Repository("id", "new", null, null);
|
||||
Path path = dao.getPath(newRepository);
|
||||
|
||||
assertThat(path.toString()).isEqualTo(context.getBaseDirectory().getPath() + "/" + InitialRepositoryLocationResolver.DEFAULT_REPOSITORY_PATH + "/id");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldFindRepositoryForRelativePath() {
|
||||
new File(context.getBaseDirectory(), "relative/path/data").mkdirs();
|
||||
|
||||
Reference in New Issue
Block a user