The UsersResource#updateUser endpoint doesn't support credential updates at
the moment.
org.keycloak.services.resources.admin.UsersResource#updateUser
org.keycloak.services.resources.admin.UsersResource#updateUserFromRep
E.g. if you want to update a password you need to use the resetPassword
endpoint:
CredentialRepresentation passwordCred = new CredentialRepresentation();
passwordCred.setTemporary(false);
passwordCred.setType(CredentialRepresentation.PASSWORD);
passwordCred.setValue("test");
keycloak.realm(realmName).users().get(userId).resetPassword(passwordCred);