@Test
  public void modifyAuthentication_local_byAdminUser() throws AmbariException {
    // given
    UserAuthenticationEntity entity = initForModifyAuthentication();

    // when
    Users users = injector.getInstance(Users.class);
    users.modifyAuthentication(entity, "admin1234", "world", false);

    // then
    assertEquals("world", entity.getAuthenticationKey());
  }
User creation should throw {@link AmbariException} in case another user exists with the same name but
different user type.
ambari-server/src/test/java/org/apache/ambari/server/security/authorization/UsersTest.java