Source:
protected void testDeleteActionForStudentAsFeedbackParticipant() { prepareTestData(); ______TS("Typical successful case when feedback participant is a student"); FeedbackQuestionsDb feedbackQuestionsDb = new FeedbackQuestionsDb(); int questionNumber = 3; FeedbackQuestionAttributes feedbackQuestion = feedbackQuestionsDb.getFeedbackQuestion("First Session", "idOfCourse1", questionNumber); String giverEmail = "student1InCourse1@gmail.tmt"; String receiverEmail = "student1InCourse1@gmail.tmt"; FeedbackResponsesDb feedbackResponsesDb = new FeedbackResponsesDb(); FeedbackResponseAttributes feedbackResponse = feedbackResponsesDb.getFeedbackResponse(feedbackQuestion.getId(), giverEmail, receiverEmail); FeedbackResponseCommentAttributes feedbackResponseComment = dataBundle.feedbackResponseComments.get("comment1FromStudent1"); FeedbackResponseCommentsDb feedbackResponseCommentsDb = new FeedbackResponseCommentsDb(); feedbackResponseComment = feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponse.getId(), feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt); assertNotNull("response comment not found", feedbackResponseComment); StudentAttributes student = dataBundle.students.get("student1InCourse1"); gaeSimulation.loginAsStudent(student.googleId); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, feedbackResponseComment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackResponseComment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponseComment.feedbackResponseId, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, feedbackResponseComment.commentText + " (Edited)", }; AjaxResult result = getAjaxResult(getAction(submissionParams)); FeedbackResponseCommentAjaxPageData data = (FeedbackResponseCommentAjaxPageData) result.data; assertFalse(data.isError); assertNull(feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponseComment.feedbackResponseId, feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt)); assertEquals("", result.getStatusMessage()); }

Target:
protected void testDeleteActionForStudentAsFeedbackParticipant() { FeedbackQuestionsDb feedbackQuestionsDb = new FeedbackQuestionsDb(); int questionNumber = 3; FeedbackQuestionAttributes feedbackQuestion = feedbackQuestionsDb.getFeedbackQuestion("First Session", "idOfCourse1", questionNumber); String giverEmail = "student1InCourse1@gmail.tmt"; String receiverEmail = "student1InCourse1@gmail.tmt"; FeedbackResponsesDb feedbackResponsesDb = new FeedbackResponsesDb(); FeedbackResponseAttributes feedbackResponse = feedbackResponsesDb.getFeedbackResponse(feedbackQuestion.getId(), giverEmail, receiverEmail); FeedbackResponseCommentAttributes feedbackResponseComment = dataBundle.feedbackResponseComments.get("comment1FromStudent1"); FeedbackResponseCommentsDb feedbackResponseCommentsDb = new FeedbackResponseCommentsDb(); feedbackResponseComment = feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponse.getId(), feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt); assertNotNull("response comment not found", feedbackResponseComment); StudentAttributes student = dataBundle.students.get("student1InCourse1"); gaeSimulation.loginAsStudent(student.googleId); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, feedbackResponseComment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackResponseComment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponseComment.feedbackResponseId, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), }; AjaxResult result = getAjaxResult(getAction(submissionParams)); FeedbackResponseCommentAjaxPageData data = (FeedbackResponseCommentAjaxPageData) result.data; assertFalse(data.isError); assertNull(feedbackResponseCommentsDb.getFeedbackResponseComment(feedbackResponseComment.feedbackResponseId, feedbackResponseComment.commentGiver, feedbackResponseComment.createdAt)); assertEquals("", result.getStatusMessage()); }