@Test(expected = InvalidUsernamePasswordCombinationException.class)
public void testBadCredentialsForMissingLoginAlias() throws Exception {

  // Given
  assertNull("User already exists in DB", userDAO.findLdapUserByName("allowedUser"));
  Authentication authentication = new UsernamePasswordAuthenticationToken("missingloginalias@ambari.apache.org", "password");
  configuration.setProperty(Configuration.LDAP_ALT_USER_SEARCH_ENABLED.getKey(), "true");
  // When
  authenticationProvider.authenticate(authentication);
  // Then
  // InvalidUsernamePasswordCombinationException should be thrown due to no user with 'missingloginalias@ambari.apache.org'  is found in ldap
}