@Test public void testGetGroups() { Repository repo1 = mockRepository("repo1"); Repository repo2 = mockRepository("repo2"); Repository group1 = mockGroupRepository("group1", repo1); when(repositoryManager.browse()).thenReturn(Arrays.asList(repo1, repo2, group1)); List<String> groups = underTest.getGroups("repo1"); assertThat(groups, contains("group1")); groups = underTest.getGroups("repo2"); assertThat(groups, empty()); groups = underTest.getGroups("repo3"); assertThat(groups, empty()); }
List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); } }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  @Subscribe void on(final RepositoryCreatedEvent event); @Subscribe void on(final RepositoryUpdatedEvent event); @Subscribe void on(final RepositoryDeletedEvent event); }
GroupMemberMappingCache extends ComponentSupport implements EventAware { List<String> getGroups(String member) { return new ArrayList<>(getCache().getOrDefault(member, Collections.emptyList())); }  @Subscribe void on(final RepositoryCreatedEvent event); @Subscribe void on(final RepositoryUpdatedEvent event); @Subscribe void on(final RepositoryDeletedEvent event);  }