mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
default repository manager should throw RepositoryNotFoundException
This commit is contained in:
@@ -103,6 +103,19 @@ public abstract class RepositoryManagerTestBase
|
||||
assertNull(manager.get(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
@Test(expected = RepositoryNotFoundException.class)
|
||||
public void testDeleteNotFound() throws RepositoryException, IOException
|
||||
{
|
||||
manager.delete(createRepositoryWithId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -156,8 +169,8 @@ public abstract class RepositoryManagerTestBase
|
||||
foundHeart = true;
|
||||
heartReference = repository;
|
||||
}
|
||||
else if (repository.getId().equals(
|
||||
happyVerticalPeopleTransporter.getId()))
|
||||
else if (
|
||||
repository.getId().equals(happyVerticalPeopleTransporter.getId()))
|
||||
{
|
||||
assertRepositoriesEquals(happyVerticalPeopleTransporter, repository);
|
||||
foundTransporter = true;
|
||||
@@ -202,10 +215,10 @@ public abstract class RepositoryManagerTestBase
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
@Test(expected = RepositoryException.class)
|
||||
public void testModifyNotExisting() throws RepositoryException, IOException
|
||||
@Test(expected = RepositoryNotFoundException.class)
|
||||
public void testModifyNotFound() throws RepositoryException, IOException
|
||||
{
|
||||
manager.modify(RepositoryTestData.createHeartOfGold());
|
||||
manager.modify(createRepositoryWithId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,6 +239,19 @@ public abstract class RepositoryManagerTestBase
|
||||
assertEquals(description, heartOfGold.getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
@Test(expected = RepositoryNotFoundException.class)
|
||||
public void testRefreshNotFound() throws RepositoryException, IOException
|
||||
{
|
||||
manager.refresh(createRepositoryWithId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -265,6 +291,21 @@ public abstract class RepositoryManagerTestBase
|
||||
return repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Repository createRepositoryWithId()
|
||||
{
|
||||
Repository repository = RepositoryTestData.createHeartOfGold();
|
||||
|
||||
repository.setId("abc");
|
||||
|
||||
return repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -104,7 +104,6 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager
|
||||
* @param configuration
|
||||
* @param contextProvider
|
||||
* @param keyGenerator
|
||||
* @param securityContextProvider
|
||||
* @param repositoryDAO
|
||||
* @param handlerSet
|
||||
* @param repositoryListenersProvider
|
||||
@@ -253,7 +252,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RepositoryException(
|
||||
throw new RepositoryNotFoundException(
|
||||
"repository ".concat(repository.getName()).concat(" not found"));
|
||||
}
|
||||
|
||||
@@ -381,7 +380,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RepositoryException(
|
||||
throw new RepositoryNotFoundException(
|
||||
"repository ".concat(repository.getName()).concat(" not found"));
|
||||
}
|
||||
|
||||
@@ -413,7 +412,7 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RepositoryException(
|
||||
throw new RepositoryNotFoundException(
|
||||
"repository ".concat(repository.getName()).concat(" not found"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user