Program: 69709
Project: 69709
Buggy source:
@Test public void testUpdateRootNodeCoursePost() throws IOException, URISyntaxException {
  assertTrue(conn.login("String_Node_Str","String_Node_Str"));
  URI uri=getCoursesUri().queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str","String_Node_Str").build();
  HttpPut method=conn.createPut(uri,MediaType.APPLICATION_JSON,true);
  HttpResponse response=conn.execute(method);
  assertEquals(200,response.getStatusLine().getStatusCode());
  CourseVO course=conn.parse(response,CourseVO.class);
  assertNotNull(course);
  assertNotNull(course.getKey());
  assertNotNull(course.getEditorRootNodeId());
  URI rootUri=getElementsUri(course).path("String_Node_Str").path(course.getEditorRootNodeId()).build();
  HttpPost updateMethod=conn.createPost(rootUri,MediaType.APPLICATION_JSON,true);
  HttpEntity entity=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  updateMethod.setEntity(entity);
  HttpResponse newStructureResponse=conn.execute(updateMethod);
  int newStructureCode=newStructureResponse.getStatusLine().getStatusCode();
  assertTrue(newStructureCode == 200 || newStructureCode == 201);
  CourseNodeVO structureNode=conn.parse(newStructureResponse,CourseNodeVO.class);
  assertNotNull(structureNode);
  assertNotNull(structureNode.getId());
  assertEquals(structureNode.getShortTitle(),"String_Node_Str");
  assertEquals(structureNode.getLongTitle(),"String_Node_Str");
  assertEquals(structureNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(structureNode.getId(),course.getEditorRootNodeId());
  ICourse realCourse=CourseFactory.loadCourse(course.getKey());
  CourseEditorTreeModel editorTreeModel=realCourse.getEditorTreeModel();
  CourseEditorTreeNode rootNode=(CourseEditorTreeNode)editorTreeModel.getRootNode();
  assertNotNull(rootNode);
  assertNotNull(rootNode.getIdent());
  assertNotNull(rootNode.getCourseNode());
  assertEquals(rootNode.getCourseNode().getShortTitle(),"String_Node_Str");
  assertEquals(rootNode.getCourseNode().getLongTitle(),"String_Node_Str");
  assertEquals(rootNode.getCourseNode().getLearningObjectives(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testUpdateRootNodeCoursePost() throws IOException, URISyntaxException {
  assertTrue(conn.login("String_Node_Str","String_Node_Str"));
  URI uri=getCoursesUri().queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str","String_Node_Str").build();
  HttpPut method=conn.createPut(uri,MediaType.APPLICATION_JSON,true);
  HttpResponse response=conn.execute(method);
  assertEquals(200,response.getStatusLine().getStatusCode());
  CourseVO course=conn.parse(response,CourseVO.class);
  assertNotNull(course);
  assertNotNull(course.getKey());
  assertNotNull(course.getEditorRootNodeId());
  URI rootUri=getElementsUri(course).path("String_Node_Str").path(course.getEditorRootNodeId()).build();
  HttpPost updateMethod=conn.createPost(rootUri,MediaType.APPLICATION_JSON);
  HttpEntity entity=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  updateMethod.setEntity(entity);
  HttpResponse newStructureResponse=conn.execute(updateMethod);
  int newStructureCode=newStructureResponse.getStatusLine().getStatusCode();
  assertTrue(newStructureCode == 200 || newStructureCode == 201);
  CourseNodeVO structureNode=conn.parse(newStructureResponse,CourseNodeVO.class);
  assertNotNull(structureNode);
  assertNotNull(structureNode.getId());
  assertEquals(structureNode.getShortTitle(),"String_Node_Str");
  assertEquals(structureNode.getLongTitle(),"String_Node_Str");
  assertEquals(structureNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(structureNode.getId(),course.getEditorRootNodeId());
  ICourse realCourse=CourseFactory.loadCourse(course.getKey());
  CourseEditorTreeModel editorTreeModel=realCourse.getEditorTreeModel();
  CourseEditorTreeNode rootNode=(CourseEditorTreeNode)editorTreeModel.getRootNode();
  assertNotNull(rootNode);
  assertNotNull(rootNode.getIdent());
  assertNotNull(rootNode.getCourseNode());
  assertEquals(rootNode.getCourseNode().getShortTitle(),"String_Node_Str");
  assertEquals(rootNode.getCourseNode().getLongTitle(),"String_Node_Str");
  assertEquals(rootNode.getCourseNode().getLearningObjectives(),"String_Node_Str");
}