Program: 60605
Project: 60605
Buggy source:
@Test public void issueSYNCOPE272(){
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  userTO.addResource("String_Node_Str");
  userTO=createUser(userTO);
  try {
    assertNotNull(userTO);
    assertEquals(1,userTO.getPropagationStatusTOs().size());
    assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
    SyncTaskTO task=taskService.read(TaskType.SYNCHRONIZATION,SYNC_TASK_ID);
    assertNotNull(task);
    AttributeTO newAttrTO=new AttributeTO();
    newAttrTO.setSchema("String_Node_Str");
    newAttrTO.setValues(Collections.singletonList("String_Node_Str"));
    UserTO template=new UserTO();
    template.addAttribute(newAttrTO);
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addResource("String_Node_Str");
    task.setUserTemplate(template);
    taskService.update(task.getId(),task);
    SyncTaskTO actual=taskService.read(TaskType.SYNCHRONIZATION,task.getId());
    assertNotNull(actual);
    assertEquals(task.getId(),actual.getId());
    TaskExecTO taskExecTO=execSyncTask(SYNC_TASK_ID,50,false);
    assertNotNull(actual);
    assertEquals(task.getId(),actual.getId());
    assertNotNull(taskExecTO.getStatus());
    assertTrue(PropagationTaskExecStatus.valueOf(taskExecTO.getStatus()).isSuccessful());
    userTO=userService.read(userTO.getUsername());
    assertNotNull(userTO);
    assertNotNull(userTO.getAttributeMap().get("String_Node_Str").getValues().get(0));
  }
  finally {
    for (int i=0; i < 10; i++) {
      String cUserName="String_Node_Str" + i;
      UserTO cUserTO=userService.read(cUserName);
      userService.delete(cUserTO.getId());
    }
  }
}

Fixed version (ground truth):
@Test public void issueSYNCOPE272(){
  removeTestUsers();
  UserTO userTO=UserTestITCase.getUniqueSampleTO("String_Node_Str");
  userTO.addResource("String_Node_Str");
  userTO=createUser(userTO);
  try {
    assertNotNull(userTO);
    assertEquals(1,userTO.getPropagationStatusTOs().size());
    assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
    SyncTaskTO task=taskService.read(TaskType.SYNCHRONIZATION,SYNC_TASK_ID);
    assertNotNull(task);
    AttributeTO newAttrTO=new AttributeTO();
    newAttrTO.setSchema("String_Node_Str");
    newAttrTO.setValues(Collections.singletonList("String_Node_Str"));
    UserTO template=new UserTO();
    template.addAttribute(newAttrTO);
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addAttribute(attributeTO("String_Node_Str","String_Node_Str"));
    template.addResource("String_Node_Str");
    task.setUserTemplate(template);
    taskService.update(task.getId(),task);
    SyncTaskTO actual=taskService.read(TaskType.SYNCHRONIZATION,task.getId());
    assertNotNull(actual);
    assertEquals(task.getId(),actual.getId());
    TaskExecTO taskExecTO=execSyncTask(SYNC_TASK_ID,50,false);
    assertNotNull(actual);
    assertEquals(task.getId(),actual.getId());
    assertNotNull(taskExecTO.getStatus());
    assertTrue(PropagationTaskExecStatus.valueOf(taskExecTO.getStatus()).isSuccessful());
    userTO=userService.read(userTO.getUsername());
    assertNotNull(userTO);
    assertNotNull(userTO.getAttributeMap().get("String_Node_Str").getValues().get(0));
  }
  finally {
    removeTestUsers();
  }
}