### Question:
DBRepositoryManager implements RepositoryManager { @Override public final Repository<?> saveRepository(final Repository<?> repository) { return repositoryDBManager.save(repository); } DBRepositoryManager(final SessionFactory sessionFactory); @Override final Repository<?> getRepository(final String name); final Repository<?> getRepository(final Serializable id); @Override final List<Repository> getRepositoryList(final Class<? extends Repository> clazz); @Override final Repository<?> saveRepository(final Repository<?> repository); @Override final void updateRepository(final Repository<?> repository); @Override final boolean deleteRepository(final Repository<?> repository); @Override final RepoPackage getRepoPackage(final Serializable id); @Override final RepoPackage saveRepoPackage(final RepoPackage repoPackage);  }### Answer:
@Test public final void testSaveRepository() throws IOException { DBRepositoryManager repoMan = new DBRepositoryManager(sessionFactory); repoMan.saveRepository(getTestRepository()); }
@Test(expectedExceptions = DBManagerException.class) public final void testDuplicateRepositoryName() throws IOException { DBRepositoryManager repoMan = new DBRepositoryManager(sessionFactory); repoMan.saveRepository(getTestRepository()); repoMan.saveRepository(getTestRepository()); }
@Test(expectedExceptions = DBManagerException.class) public final void verifySpacewalkRepositoryUniqueConstraints() throws IOException { DBRepositoryManager repoMan = new DBRepositoryManager(sessionFactory); SpacewalkChannelRepository repo1 = getTestSpacewalkRepository(); SpacewalkChannelRepository repo2 = getTestSpacewalkRepository(); repoMan.saveRepository(repo1); repoMan.saveRepository(repo2); }