GroupMemberMappingCache extends ComponentSupport implements EventAware { @Subscribe public void on(final RepositoryCreatedEvent event) { log.debug("Handling repository create event for {}", event.getRepository().getName()); if (event.getRepository().optionalFacet(GroupFacet.class).isPresent()) { memberInGroupsMap = null; } }  @Subscribe void on(final RepositoryCreatedEvent event); @Subscribe void on(final RepositoryUpdatedEvent event); @Subscribe void on(final RepositoryDeletedEvent event);  }
@Test public void testOnRepositoryCreatedEvent_nonGroupRepo() { Repository repo = mockRepository("repo"); when(repositoryManager.browse()).thenReturn(Collections.emptyList()); underTest.on(new RepositoryCreatedEvent(repo)); verify(repositoryManager, never()).browse(); }
@Test public void testOnRepositoryUpdatedEvent_nonGroupRepo() { Repository repo = mockRepository("repo"); when(repositoryManager.browse()).thenReturn(Collections.emptyList()); underTest.on(new RepositoryUpdatedEvent(repo, null)); verify(repositoryManager, never()).browse(); }