Program: 60593
Project: 60593
Buggy source:
@Test public void create(){
  ConfigurationTO configurationTO=new ConfigurationTO();
  configurationTO.setKey("String_Node_Str");
  configurationTO.setValue("String_Node_Str");
  Response response=configurationService.create(configurationTO);
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  configurationTO=getObject(response,ConfigurationTO.class,configurationService);
  assertNotNull(configurationTO);
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  try {
    createUserRequest(new UserRequestTO(userTO));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  configurationTO.setValue("String_Node_Str");
  response=configurationService.create(configurationTO);
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  configurationTO=getObject(response,ConfigurationTO.class,configurationService);
  assertNotNull(configurationTO);
  UserRequestService userRequestService2=setupCredentials(userRequestService,null,null);
  response=userRequestService2.create(new UserRequestTO(userTO));
  UserRequestTO request=getObject(response,UserRequestTO.class,userRequestService2);
  super.resetRestTemplate();
  AttributeCond attrCond=new AttributeCond(AttributeCond.Type.EQ);
  attrCond.setSchema("String_Node_Str");
  attrCond.setExpression(userTO.getUsername());
  final List<UserTO> matchingUsers=userService.search(NodeCond.getLeafCond(attrCond));
  assertTrue(matchingUsers.isEmpty());
  userTO=createUser(request.getUserTO());
  assertNotNull(userTO);
}

Fixed version (ground truth):
@Test public void create() throws InvalidSearchConditionException {
  ConfigurationTO configurationTO=new ConfigurationTO();
  configurationTO.setKey("String_Node_Str");
  configurationTO.setValue("String_Node_Str");
  Response response=configurationService.create(configurationTO);
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  configurationTO=getObject(response,ConfigurationTO.class,configurationService);
  assertNotNull(configurationTO);
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  try {
    createUserRequest(new UserRequestTO(userTO));
    fail();
  }
 catch (  SyncopeClientCompositeErrorException e) {
    assertNotNull(e.getException(SyncopeClientExceptionType.UnauthorizedRole));
  }
  configurationTO.setValue("String_Node_Str");
  response=configurationService.create(configurationTO);
  assertNotNull(response);
  assertEquals(org.apache.http.HttpStatus.SC_CREATED,response.getStatus());
  configurationTO=getObject(response,ConfigurationTO.class,configurationService);
  assertNotNull(configurationTO);
  UserRequestService userRequestService2=setupCredentials(userRequestService,UserRequestService.class,null,null);
  response=userRequestService2.create(new UserRequestTO(userTO));
  UserRequestTO request=getObject(response,UserRequestTO.class,userRequestService2);
  super.resetRestTemplate();
  AttributeCond attrCond=new AttributeCond(AttributeCond.Type.EQ);
  attrCond.setSchema("String_Node_Str");
  attrCond.setExpression(userTO.getUsername());
  final List<UserTO> matchingUsers=userService.search(NodeCond.getLeafCond(attrCond));
  assertTrue(matchingUsers.isEmpty());
  userTO=createUser(request.getUserTO());
  assertNotNull(userTO);
}