ExternalIDPManagerImpl extends AbstractServiceTracker<ExternalIdentityProvider> implements ExternalIdentityProviderManager { @Override public ExternalIdentityProvider getProvider(@NotNull String name) { for (ExternalIdentityProvider provider: getServices()) { if (name.equals(provider.getName())) { return provider; } } return null; } @SuppressWarnings("UnusedDeclaration")  ExternalIDPManagerImpl();  ExternalIDPManagerImpl(Whiteboard whiteboard); @Override ExternalIdentityProvider getProvider(@NotNull String name);  }
@Test public void testGetProvider() { assertNull(externalIDPManager.getProvider("test")); assertNull(externalIDPManager.getProvider("unknown")); ExternalIdentityProvider provider = when(mock(ExternalIdentityProvider.class).getName()).thenReturn("test").getMock(); context.registerService(ExternalIdentityProvider.class, provider); assertSame(provider, externalIDPManager.getProvider("test")); assertNull(externalIDPManager.getProvider("unknown")); }