RepositoryManagerRESTAdapterImpl implements RepositoryManagerRESTAdapter { @Override public List<String> findContainingGroups(final String repositoryName) { return repositoryManager.findContainingGroups(repositoryName); } @Inject  RepositoryManagerRESTAdapterImpl(final RepositoryManager repositoryManager,
                                          final RepositoryPermissionChecker repositoryPermissionChecker); @Override Repository getRepository(final String repositoryId); @Override List<Repository> getRepositories(); @Override List<String> findContainingGroups(final String repositoryName);  }
@Test public void findContainingGroupsShouldDelegateToRepositoryManager() { String repositoryName = "aRepository"; List<String> repositoryNames = asList("group1", "group2"); when(repositoryManager.findContainingGroups(repositoryName)).thenReturn(repositoryNames); List<String> containingGroups = underTest.findContainingGroups(repositoryName); assertThat(containingGroups, is(repositoryNames)); }