use of teammates.storage.api.FeedbackResponseCommentsDb in project teammates by TEAMMATES.
the class InstructorFeedbackResponseCommentEditActionTest method testAccessControl.
@Override
@Test
protected void testAccessControl() throws Exception {
final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb();
final FeedbackResponsesDb frDb = new FeedbackResponsesDb();
final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb();
FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1");
int questionNumber = 1;
FeedbackQuestionAttributes feedbackQuestion = fqDb.getFeedbackQuestion("First feedback session", "idOfTypicalCourse1", questionNumber);
String giverEmail = "student1InCourse1@gmail.tmt";
String receiverEmail = "student1InCourse1@gmail.tmt";
FeedbackResponseAttributes feedbackResponse = frDb.getFeedbackResponse(feedbackQuestion.getId(), giverEmail, receiverEmail);
FeedbackResponseCommentAttributes feedbackResponseComment = typicalBundle.feedbackResponseComments.get("comment1FromT1C1ToR1Q1S1C1");
feedbackResponseComment = frcDb.getFeedbackResponseComment(feedbackResponse.getId(), feedbackResponseComment.giverEmail, feedbackResponseComment.createdAt);
String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponse.getId(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, "comment", Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "recipient" };
// this person is not the giver. so not accessible
verifyUnaccessibleWithoutModifySessionCommentInSectionsPrivilege(submissionParams);
verifyOnlyInstructorsCanAccess(submissionParams);
}
Aggregations