Program: 69711
Project: 69711
Buggy source:
@Test public void testCreateCoursePost() 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 newStructureUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newStructureMethod=conn.createPost(newStructureUri,MediaType.APPLICATION_JSON,true);
  HttpEntity newStructureEnttiy=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addTextBody("String_Node_Str",course.getEditorRootNodeId()).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  newStructureMethod.setEntity(newStructureEnttiy);
  HttpResponse newStructureResponse=conn.execute(newStructureMethod);
  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.getParentId(),course.getEditorRootNodeId());
  URL pageUrl=CoursesElementsTest.class.getResource("String_Node_Str");
  assertNotNull(pageUrl);
  File page=new File(pageUrl.toURI());
  URI newPageUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newPageMethod=conn.createPost(newPageUri,MediaType.APPLICATION_JSON,true);
  HttpEntity entity=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addBinaryBody("String_Node_Str",page,ContentType.APPLICATION_OCTET_STREAM,page.getName()).addTextBody("String_Node_Str",page.getName()).addTextBody("String_Node_Str",course.getEditorRootNodeId()).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  newPageMethod.setEntity(entity);
  HttpResponse newPageCode=conn.execute(newPageMethod);
  assertTrue(newPageCode.getStatusLine().getStatusCode() == 200 || newPageCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO pageNode=conn.parse(newPageCode,CourseNodeVO.class);
  assertNotNull(pageNode);
  assertNotNull(pageNode.getId());
  assertEquals(pageNode.getShortTitle(),"String_Node_Str");
  assertEquals(pageNode.getLongTitle(),"String_Node_Str");
  assertEquals(pageNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(structureNode.getParentId(),course.getEditorRootNodeId());
  URI newFolderUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newFolderMethod=conn.createPost(newFolderUri,MediaType.APPLICATION_JSON,true);
  String rule="String_Node_Str";
  conn.addEntity(newFolderMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str",rule),new BasicNameValuePair("String_Node_Str",rule),new BasicNameValuePair("String_Node_Str",rule));
  HttpResponse newFolderCode=conn.execute(newFolderMethod);
  assertTrue(newFolderCode.getStatusLine().getStatusCode() == 200 || newFolderCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO folderNode=conn.parse(newFolderCode,CourseNodeVO.class);
  assertNotNull(folderNode);
  assertNotNull(folderNode.getId());
  assertEquals(folderNode.getShortTitle(),"String_Node_Str");
  assertEquals(folderNode.getLongTitle(),"String_Node_Str");
  assertEquals(folderNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(folderNode.getParentId(),course.getEditorRootNodeId());
  URI newForumUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newForumMethod=conn.createPost(newForumUri,MediaType.APPLICATION_JSON,true);
  conn.addEntity(newForumMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newForumCode=conn.execute(newForumMethod);
  assertTrue(newForumCode.getStatusLine().getStatusCode() == 200 || newForumCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO forumNode=conn.parse(newForumCode,CourseNodeVO.class);
  assertNotNull(forumNode);
  assertNotNull(forumNode.getId());
  assertEquals(forumNode.getShortTitle(),"String_Node_Str");
  assertEquals(forumNode.getLongTitle(),"String_Node_Str");
  assertEquals(forumNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(forumNode.getParentId(),course.getEditorRootNodeId());
  URI newTaskUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newTaskMethod=conn.createPost(newTaskUri,MediaType.APPLICATION_JSON,true);
  conn.addEntity(newTaskMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newTaskCode=conn.execute(newTaskMethod);
  assertTrue(newTaskCode.getStatusLine().getStatusCode() == 200 || newTaskCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO taskNode=conn.parse(newTaskCode,CourseNodeVO.class);
  assertNotNull(taskNode);
  assertNotNull(taskNode.getId());
  assertEquals(taskNode.getShortTitle(),"String_Node_Str");
  assertEquals(taskNode.getLongTitle(),"String_Node_Str");
  assertEquals(taskNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(taskNode.getParentId(),course.getEditorRootNodeId());
  URI newTestUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newTestMethod=conn.createPost(newTestUri,MediaType.APPLICATION_JSON,true);
  conn.addEntity(newTestMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newTestCode=conn.execute(newTestMethod);
  assertTrue(newTestCode.getStatusLine().getStatusCode() == 404);
  EntityUtils.consume(newTestCode.getEntity());
  URI newAssessmentUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newAssessmentMethod=conn.createPost(newAssessmentUri,MediaType.APPLICATION_JSON,true);
  conn.addEntity(newAssessmentMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newAssessmentCode=conn.execute(newAssessmentMethod);
  assertTrue(newAssessmentCode.getStatusLine().getStatusCode() == 200 || newAssessmentCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO assessmentNode=conn.parse(newAssessmentCode,CourseNodeVO.class);
  assertNotNull(assessmentNode);
  assertNotNull(assessmentNode.getId());
  assertEquals(assessmentNode.getShortTitle(),"String_Node_Str");
  assertEquals(assessmentNode.getLongTitle(),"String_Node_Str");
  assertEquals(assessmentNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(assessmentNode.getParentId(),course.getEditorRootNodeId());
  URI newContactUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newContactMethod=conn.createPost(newContactUri,MediaType.APPLICATION_JSON,true);
  conn.addEntity(newContactMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newContactCode=conn.execute(newContactMethod);
  assertEquals(200,newContactCode.getStatusLine().getStatusCode());
  CourseNodeVO contactNode=conn.parse(newContactCode,CourseNodeVO.class);
  assertNotNull(contactNode);
  assertNotNull(contactNode.getId());
  assertEquals(contactNode.getShortTitle(),"String_Node_Str");
  assertEquals(contactNode.getLongTitle(),"String_Node_Str");
  assertEquals(contactNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(contactNode.getParentId(),course.getEditorRootNodeId());
}

Fixed version (ground truth):
@Test public void testCreateCoursePost() 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 newStructureUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newStructureMethod=conn.createPost(newStructureUri,MediaType.APPLICATION_JSON);
  HttpEntity newStructureEnttiy=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addTextBody("String_Node_Str",course.getEditorRootNodeId()).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  newStructureMethod.setEntity(newStructureEnttiy);
  HttpResponse newStructureResponse=conn.execute(newStructureMethod);
  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.getParentId(),course.getEditorRootNodeId());
  URL pageUrl=CoursesElementsTest.class.getResource("String_Node_Str");
  assertNotNull(pageUrl);
  File page=new File(pageUrl.toURI());
  URI newPageUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newPageMethod=conn.createPost(newPageUri,MediaType.APPLICATION_JSON);
  HttpEntity entity=MultipartEntityBuilder.create().setMode(HttpMultipartMode.BROWSER_COMPATIBLE).addBinaryBody("String_Node_Str",page,ContentType.APPLICATION_OCTET_STREAM,page.getName()).addTextBody("String_Node_Str",page.getName()).addTextBody("String_Node_Str",course.getEditorRootNodeId()).addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").addTextBody("String_Node_Str","String_Node_Str").build();
  newPageMethod.setEntity(entity);
  HttpResponse newPageCode=conn.execute(newPageMethod);
  assertTrue(newPageCode.getStatusLine().getStatusCode() == 200 || newPageCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO pageNode=conn.parse(newPageCode,CourseNodeVO.class);
  assertNotNull(pageNode);
  assertNotNull(pageNode.getId());
  assertEquals(pageNode.getShortTitle(),"String_Node_Str");
  assertEquals(pageNode.getLongTitle(),"String_Node_Str");
  assertEquals(pageNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(structureNode.getParentId(),course.getEditorRootNodeId());
  URI newFolderUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newFolderMethod=conn.createPost(newFolderUri,MediaType.APPLICATION_JSON);
  String rule="String_Node_Str";
  conn.addEntity(newFolderMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str",rule),new BasicNameValuePair("String_Node_Str",rule),new BasicNameValuePair("String_Node_Str",rule));
  HttpResponse newFolderCode=conn.execute(newFolderMethod);
  assertTrue(newFolderCode.getStatusLine().getStatusCode() == 200 || newFolderCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO folderNode=conn.parse(newFolderCode,CourseNodeVO.class);
  assertNotNull(folderNode);
  assertNotNull(folderNode.getId());
  assertEquals(folderNode.getShortTitle(),"String_Node_Str");
  assertEquals(folderNode.getLongTitle(),"String_Node_Str");
  assertEquals(folderNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(folderNode.getParentId(),course.getEditorRootNodeId());
  URI newForumUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newForumMethod=conn.createPost(newForumUri,MediaType.APPLICATION_JSON);
  conn.addEntity(newForumMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newForumCode=conn.execute(newForumMethod);
  assertTrue(newForumCode.getStatusLine().getStatusCode() == 200 || newForumCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO forumNode=conn.parse(newForumCode,CourseNodeVO.class);
  assertNotNull(forumNode);
  assertNotNull(forumNode.getId());
  assertEquals(forumNode.getShortTitle(),"String_Node_Str");
  assertEquals(forumNode.getLongTitle(),"String_Node_Str");
  assertEquals(forumNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(forumNode.getParentId(),course.getEditorRootNodeId());
  URI newTaskUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newTaskMethod=conn.createPost(newTaskUri,MediaType.APPLICATION_JSON);
  conn.addEntity(newTaskMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newTaskCode=conn.execute(newTaskMethod);
  assertTrue(newTaskCode.getStatusLine().getStatusCode() == 200 || newTaskCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO taskNode=conn.parse(newTaskCode,CourseNodeVO.class);
  assertNotNull(taskNode);
  assertNotNull(taskNode.getId());
  assertEquals(taskNode.getShortTitle(),"String_Node_Str");
  assertEquals(taskNode.getLongTitle(),"String_Node_Str");
  assertEquals(taskNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(taskNode.getParentId(),course.getEditorRootNodeId());
  URI newTestUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newTestMethod=conn.createPost(newTestUri,MediaType.APPLICATION_JSON);
  conn.addEntity(newTestMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newTestCode=conn.execute(newTestMethod);
  assertTrue(newTestCode.getStatusLine().getStatusCode() == 404);
  EntityUtils.consume(newTestCode.getEntity());
  URI newAssessmentUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newAssessmentMethod=conn.createPost(newAssessmentUri,MediaType.APPLICATION_JSON);
  conn.addEntity(newAssessmentMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newAssessmentCode=conn.execute(newAssessmentMethod);
  assertTrue(newAssessmentCode.getStatusLine().getStatusCode() == 200 || newAssessmentCode.getStatusLine().getStatusCode() == 201);
  CourseNodeVO assessmentNode=conn.parse(newAssessmentCode,CourseNodeVO.class);
  assertNotNull(assessmentNode);
  assertNotNull(assessmentNode.getId());
  assertEquals(assessmentNode.getShortTitle(),"String_Node_Str");
  assertEquals(assessmentNode.getLongTitle(),"String_Node_Str");
  assertEquals(assessmentNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(assessmentNode.getParentId(),course.getEditorRootNodeId());
  URI newContactUri=getElementsUri(course).path("String_Node_Str").build();
  HttpPost newContactMethod=conn.createPost(newContactUri,MediaType.APPLICATION_JSON);
  conn.addEntity(newContactMethod,new BasicNameValuePair("String_Node_Str",course.getEditorRootNodeId()),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"),new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  HttpResponse newContactCode=conn.execute(newContactMethod);
  assertEquals(200,newContactCode.getStatusLine().getStatusCode());
  CourseNodeVO contactNode=conn.parse(newContactCode,CourseNodeVO.class);
  assertNotNull(contactNode);
  assertNotNull(contactNode.getId());
  assertEquals(contactNode.getShortTitle(),"String_Node_Str");
  assertEquals(contactNode.getLongTitle(),"String_Node_Str");
  assertEquals(contactNode.getLearningObjectives(),"String_Node_Str");
  assertEquals(contactNode.getParentId(),course.getEditorRootNodeId());
}