}
public void testCreatePasswordCredentialManagingAuthenticationProviderFailsWhenAnotherOneAlready()
{
Broker broker = mock(Broker.class);
PasswordCredentialManagingAuthenticationProvider anotherProvider = mock(PasswordCredentialManagingAuthenticationProvider.class);
when(broker.getAuthenticationProviders()).thenReturn(Collections.<AuthenticationProvider>singleton(anotherProvider));
QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
when(managerFactory.createInstance(any(Broker.class), any(Map.class))).thenReturn(mock(PrincipalDatabaseAuthenticationManager.class));