Source:
protected void testAccessControl() throws Exception { final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb(); final FeedbackResponsesDb frDb = new FeedbackResponsesDb(); final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb(); int questionNumber = 1; FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("session1InCourse1"); FeedbackQuestionAttributes question = fqDb.getFeedbackQuestion( fs.getFeedbackSessionName(), fs.getCourseId(), questionNumber); String giverEmail = "student1InCourse1@gmail.tmt"; String receiverEmail = "student1InCourse1@gmail.tmt"; FeedbackResponseAttributes response = frDb.getFeedbackResponse(question.getId(), giverEmail, receiverEmail); FeedbackResponseCommentAttributes comment = FeedbackResponseCommentAttributes.builder(fs.getCourseId(), fs.getFeedbackSessionName()) .withGiverEmail(giverEmail) .withFeedbackQuestionId(question.getId()) .withFeedbackResponseId(response.getId()) .build(); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, comment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, comment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, "", Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "recipient", Const.ParamsNames.FEEDBACK_QUESTION_ID, comment.feedbackQuestionId, Const.ParamsNames.FEEDBACK_RESPONSE_ID, comment.feedbackResponseId, Const.ParamsNames.COMMENT_ID, "1-1-1-1" }; verifyUnaccessibleWithoutSubmitSessionInSectionsPrivilege(submissionParams); verifyUnaccessibleWithoutLogin(submissionParams); verifyUnaccessibleForUnregisteredUsers(submissionParams); verifyUnaccessibleForStudents(submissionParams); verifyAccessibleForInstructorsOfTheSameCourse(submissionParams); verifyAccessibleForAdminToMasqueradeAsInstructor(submissionParams); frcDb.deleteEntity(comment); }

Target:
protected void testAccessControl() throws Exception { final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb(); final FeedbackResponsesDb frDb = new FeedbackResponsesDb(); final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb(); int questionNumber = 1; FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("session1InCourse1"); FeedbackQuestionAttributes question = fqDb.getFeedbackQuestion( fs.getFeedbackSessionName(), fs.getCourseId(), questionNumber); String giverEmail = "student1InCourse1@gmail.tmt"; String receiverEmail = "student1InCourse1@gmail.tmt"; FeedbackResponseAttributes response = frDb.getFeedbackResponse(question.getId(), giverEmail, receiverEmail); FeedbackResponseCommentAttributes comment = FeedbackResponseCommentAttributes .builder(fs.getCourseId(), fs.getFeedbackSessionName(), giverEmail, new Text("")) .withFeedbackQuestionId(question.getId()) .withFeedbackResponseId(response.getId()) .build(); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, comment.courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, comment.feedbackSessionName, Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, "", Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "recipient", Const.ParamsNames.FEEDBACK_QUESTION_ID, comment.feedbackQuestionId, Const.ParamsNames.FEEDBACK_RESPONSE_ID, comment.feedbackResponseId, Const.ParamsNames.COMMENT_ID, "1-1-1-1" }; verifyUnaccessibleWithoutSubmitSessionInSectionsPrivilege(submissionParams); verifyUnaccessibleWithoutLogin(submissionParams); verifyUnaccessibleForUnregisteredUsers(submissionParams); verifyUnaccessibleForStudents(submissionParams); verifyAccessibleForInstructorsOfTheSameCourse(submissionParams); verifyAccessibleForAdminToMasqueradeAsInstructor(submissionParams); frcDb.deleteEntity(comment); }