Program: 60594
Project: 60594
Buggy source:
@Test public void update(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  String initialPassword=userTO.getPassword();
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserMod userMod=new UserMod();
  userMod.setId(userTO.getId());
  userMod.setPassword(initialPassword);
  try {
    createUserRequest(new UserRequestTO(userMod));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  UserRequestService userRequestService2=setupCredentials(userRequestService,userTO.getUsername(),initialPassword);
  try {
    Response response=userRequestService2.create(new UserRequestTO(userMod));
    if (response.getStatus() != org.apache.http.HttpStatus.SC_CREATED) {
      throw (RuntimeException)clientExceptionMapper.fromResponse(response);
    }
    fail();
  }
 catch (  SyncopeClientCompositeErrorException scce) {
    assertNotNull(scce.getException(SyncopeClientExceptionType.InvalidSyncopeUser));
  }
  userMod.setPassword("String_Node_Str" + initialPassword);
  Response response=userRequestService.create(new UserRequestTO(userMod));
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  super.resetRestTemplate();
  Boolean verify=userService.verifyPassword(userTO.getUsername(),userMod.getPassword());
  assertFalse(verify);
  userTO=userService.update(userMod.getId(),userMod);
  assertNotNull(userTO);
  verify=userService.verifyPassword(userTO.getUsername(),userMod.getPassword());
  assertTrue(verify);
}

Fixed version (ground truth):
@Test public void update(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  String initialPassword=userTO.getPassword();
  userTO=createUser(userTO);
  assertNotNull(userTO);
  UserMod userMod=new UserMod();
  userMod.setId(userTO.getId());
  userMod.setPassword(initialPassword);
  try {
    createUserRequest(new UserRequestTO(userMod));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  UserRequestService userRequestService2=setupCredentials(userRequestService,UserRequestService.class,userTO.getUsername(),initialPassword);
  try {
    Response response=userRequestService2.create(new UserRequestTO(userMod));
    if (response.getStatus() != org.apache.http.HttpStatus.SC_CREATED) {
      throw (RuntimeException)clientExceptionMapper.fromResponse(response);
    }
    fail();
  }
 catch (  SyncopeClientCompositeErrorException scce) {
    assertNotNull(scce.getException(SyncopeClientExceptionType.InvalidSyncopeUser));
  }
  userMod.setPassword("String_Node_Str" + initialPassword);
  Response response=userRequestService.create(new UserRequestTO(userMod));
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  super.resetRestTemplate();
  Boolean verify=userService.verifyPassword(userTO.getUsername(),userMod.getPassword());
  assertFalse(verify);
  userTO=userService.update(userMod.getId(),userMod);
  assertNotNull(userTO);
  verify=userService.verifyPassword(userTO.getUsername(),userMod.getPassword());
  assertTrue(verify);
}