### Question:
UmaIdRepoCreationListener implements IdRepoCreationListener { @Override public synchronized void notify(AMIdentityRepository idRepo, String realm) { String normalizedRealm = coreWrapper.convertRealmNameToOrgName(realm); if (!registeredRealms.contains(normalizedRealm)) { idRepo.addEventListener(policyApplicationListener); registeredRealms.add(normalizedRealm); } } @Inject  UmaIdRepoCreationListener(UmaPolicyApplicationListener policyApplicationListener, CoreWrapper coreWrapper); @Override synchronized void notify(AMIdentityRepository idRepo, String realm);  }### Answer:
@Test public void testNotify() throws Exception { AMIdentityRepository repo = mock(AMIdentityRepository.class); given(coreWrapper.convertRealmNameToOrgName("/test")).willReturn("ou=test"); listener.notify(repo, "/test"); verify(repo).addEventListener(umaPolicyApplicationListener); }
@Test public void testNotifyMixedCase() throws Exception { AMIdentityRepository repo = mock(AMIdentityRepository.class); given(coreWrapper.convertRealmNameToOrgName(or(eq("/test"), eq("/TEST")))).willReturn("ou=test"); listener.notify(repo, "/test"); listener.notify(repo, "/TEST"); verify(repo, times(1)).addEventListener(umaPolicyApplicationListener); }