@Test
public void testSetUserLdap() throws Exception {

  users.createUser("user", "user");
  users.createUser("user_ldap", "user_ldap", UserType.LDAP, true, false);
  users.setUserLdap("user");
  Assert.assertEquals(true, users.getAnyUser("user").isLdapUser());
  try {
    users.setUserLdap("fake user");
    Assert.fail("It shouldn't be possible to call setUserLdap() on non-existing user");
  } catch (AmbariException ex) {
  }
}