Search in sources :

Example 11 with RedirectResult

use of teammates.ui.controller.RedirectResult in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionEditActionTest method testExecuteAndPostProcessContributionQuestion.

@Test
public void testExecuteAndPostProcessContributionQuestion() {
    DataBundle dataBundle = loadDataBundle("/FeedbackSessionQuestionTypeTest.json");
    removeAndRestoreDataBundle(dataBundle);
    InstructorAttributes instructor1ofCourse1 = dataBundle.instructors.get("instructor1OfCourse1");
    gaeSimulation.loginAsInstructor(instructor1ofCourse1.googleId);
    FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("contribSession");
    FeedbackQuestionAttributes fq = FeedbackQuestionsLogic.inst().getFeedbackQuestion(fs.getFeedbackSessionName(), fs.getCourseId(), 1);
    FeedbackResponsesDb frDb = new FeedbackResponsesDb();
    FeedbackContributionQuestionDetails fqd = (FeedbackContributionQuestionDetails) fq.getQuestionDetails();
    ______TS("Edit text");
    // There are already responses for this question
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    String[] editTextParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, fq.recipientType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONTRIB", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, fqd.getQuestionText() + "(edited)", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES, "1", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId(), Const.ParamsNames.FEEDBACK_QUESTION_CONTRIBISNOTSUREALLOWED, "on" };
    InstructorFeedbackQuestionEditAction a = getAction(editTextParams);
    RedirectResult r = getRedirectResult(a);
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONTRIB+Session", "FSQTT.idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertFalse(r.isError);
    // All existing responses should remain
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    ______TS("Edit: Invalid recipient type");
    String[] editRecipientTypeParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONTRIB", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, fqd.getQuestionText(), Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES, "1", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(editRecipientTypeParams);
    r = getRedirectResult(a);
    assertEquals(Const.FeedbackQuestion.CONTRIB_ERROR_INVALID_FEEDBACK_PATH + "<br>" + Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONTRIB+Session", "FSQTT.idOfInstructor1OfCourse1", true), r.getDestinationWithParams());
    assertTrue(r.isError);
    // delete session to clean database
    FeedbackSessionsLogic.inst().deleteFeedbackSessionCascade(fs.getFeedbackSessionName(), fs.getCourseId());
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackQuestionEditAction(teammates.ui.controller.InstructorFeedbackQuestionEditAction) FeedbackContributionQuestionDetails(teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails) DataBundle(teammates.common.datatransfer.DataBundle) RedirectResult(teammates.ui.controller.RedirectResult) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) FeedbackResponsesDb(teammates.storage.api.FeedbackResponsesDb) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Example 12 with RedirectResult

use of teammates.ui.controller.RedirectResult in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionEditActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    gaeSimulation.loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").googleId);
    FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1");
    FeedbackQuestionAttributes fq = FeedbackQuestionsLogic.inst().getFeedbackQuestion(fs.getFeedbackSessionName(), fs.getCourseId(), 1);
    ______TS("Typical Case");
    String[] typicalParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    InstructorFeedbackQuestionEditAction a = getAction(typicalParams);
    RedirectResult r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    ______TS("Custom number of recipient");
    String[] customParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "custom", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES, "2", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(customParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    ______TS("Anonymous Team Session");
    String[] teamParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.TEAMS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(teamParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    ______TS("Self Feedback");
    String[] selfParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.SELF.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(selfParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    ______TS("Question text requires sanitization");
    String[] sanitizeParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.SELF.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "attempted html injection '\"/>", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(sanitizeParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    String expectedLogMessage = "TEAMMATESLOG|||instructorFeedbackQuestionEdit|||" + "instructorFeedbackQuestionEdit|||true|||" + "Instructor|||Instructor 1 of Course 1|||" + "idOfInstructor1OfCourse1|||instr1@course1.tmt|||" + "Feedback Question 1 for session:<span class=\"bold\">" + "(First feedback session)</span> for Course " + "<span class=\"bold\">[idOfTypicalCourse1]</span>" + " edited.<br><span class=\"bold\">Essay question:</span> " + "attempted html injection &#39;&quot;&#x2f;&gt;|||/page/instructorFeedbackQuestionEdit";
    AssertHelper.assertLogMessageEquals(expectedLogMessage, a.getLogMessage());
    ______TS("Invalid edit type");
    String[] invalidEditTypeParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), // change to invalid edit type.
    Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, // change to invalid edit type.
    "INVALID", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    verifyAssumptionFailure(invalidEditTypeParams);
    ______TS("Invalid questionNumber");
    String[] invalidQnNumParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.SELF.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    // change questionNumber to an invalid number
    modifyParamValue(invalidQnNumParams, Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "-1");
    verifyAssumptionFailure(invalidQnNumParams);
    // change questionNumber to invalid "number"
    modifyParamValue(invalidQnNumParams, Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "ABC");
    try {
        a = getAction(invalidQnNumParams);
        r = getRedirectResult(a);
        signalFailureToDetectException();
    } catch (NumberFormatException e) {
        ignoreExpectedException();
    }
    ______TS("Invalid parameters");
    String[] invalidParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.TEAMS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.OWN_TEAM_MEMBERS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(invalidParams);
    r = getRedirectResult(a);
    assertEquals(String.format(FieldValidator.PARTICIPANT_TYPE_TEAM_ERROR_MESSAGE, FeedbackParticipantType.OWN_TEAM_MEMBERS.toDisplayRecipientName(), FeedbackParticipantType.TEAMS.toDisplayGiverName()), r.getStatusMessage());
    ______TS("Delete Feedback");
    String[] deleteParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, "1", Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, "", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "delete", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(deleteParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "idOfTypicalCourse1", "First+feedback+session", "idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED, r.getStatusMessage());
    assertFalse(r.isError);
    ______TS("Unsuccessful case: test null course id parameter");
    String[] submissionParams = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    try {
        a = getAction(submissionParams);
        r = getRedirectResult(a);
        signalFailureToDetectException("Did not detect that parameters are null.");
    } catch (NullPostParameterException e) {
        assertEquals(String.format(Const.StatusCodes.NULL_POST_PARAMETER, Const.ParamsNames.COURSE_ID), e.getMessage());
    }
    ______TS("Unsuccessful case: test null course id parameter");
    submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, FeedbackParticipantType.STUDENTS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "TEXT", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "question", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.RECEIVER.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    try {
        a = getAction(submissionParams);
        r = getRedirectResult(a);
        signalFailureToDetectException("Did not detect that parameters are null.");
    } catch (NullPostParameterException e) {
        assertEquals(String.format(Const.StatusCodes.NULL_POST_PARAMETER, Const.ParamsNames.FEEDBACK_SESSION_NAME), e.getMessage());
    }
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) NullPostParameterException(teammates.common.exception.NullPostParameterException) InstructorFeedbackQuestionEditAction(teammates.ui.controller.InstructorFeedbackQuestionEditAction) RedirectResult(teammates.ui.controller.RedirectResult) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) Test(org.testng.annotations.Test)

Example 13 with RedirectResult

use of teammates.ui.controller.RedirectResult in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionEditActionTest method testExecuteAndPostProcessConstSumRecipient.

@Test
public void testExecuteAndPostProcessConstSumRecipient() {
    DataBundle dataBundle = loadDataBundle("/FeedbackSessionQuestionTypeTest.json");
    removeAndRestoreDataBundle(dataBundle);
    InstructorAttributes instructor1ofCourse1 = dataBundle.instructors.get("instructor1OfCourse1");
    gaeSimulation.loginAsInstructor(instructor1ofCourse1.googleId);
    FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("constSumSession");
    FeedbackQuestionAttributes fq = FeedbackQuestionsLogic.inst().getFeedbackQuestion(fs.getFeedbackSessionName(), fs.getCourseId(), 2);
    FeedbackResponsesDb frDb = new FeedbackResponsesDb();
    FeedbackConstantSumQuestionDetails fqd = (FeedbackConstantSumQuestionDetails) fq.getQuestionDetails();
    ______TS("Edit text");
    // There are already responses for this question
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    String[] editTextParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, fq.recipientType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONSTSUM", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, fqd.getQuestionText() + "(edited)", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTS, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHOPTION, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHRECIPIENT, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSPEROPTION, String.valueOf(fqd.isPointsPerOption()), Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, Integer.toString(fqd.getNumOfConstSumOptions()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMTORECIPIENTS, String.valueOf(fqd.isDistributeToRecipients()), Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "custom", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES, "2", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    InstructorFeedbackQuestionEditAction a = getAction(editTextParams);
    RedirectResult r = getRedirectResult(a);
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONSTSUM+Session", "FSQTT.idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertFalse(r.isError);
    // All existing responses should remain
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    ______TS("Edit points per option");
    String[] editPointsParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, fq.recipientType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONSTSUM", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, fqd.getQuestionText() + "(edited)", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTS, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHOPTION, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHRECIPIENT, Integer.toString(fqd.getPoints()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSPEROPTION, String.valueOf(fqd.isPointsPerOption()), Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, Integer.toString(fqd.getNumOfConstSumOptions()), Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMTORECIPIENTS, String.valueOf(fqd.isDistributeToRecipients()), Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "custom", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIES, "2", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    // Reverse it from true to false
    modifyParamValue(editPointsParams, Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSPEROPTION, "false");
    a = getAction(editPointsParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONSTSUM+Session", "FSQTT.idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    // All existing responses should be deleted as the options are edited
    assertTrue(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackQuestionEditAction(teammates.ui.controller.InstructorFeedbackQuestionEditAction) FeedbackConstantSumQuestionDetails(teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails) DataBundle(teammates.common.datatransfer.DataBundle) RedirectResult(teammates.ui.controller.RedirectResult) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) FeedbackResponsesDb(teammates.storage.api.FeedbackResponsesDb) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Example 14 with RedirectResult

use of teammates.ui.controller.RedirectResult in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionEditActionTest method testExecuteAndPostProcessConstSumOption.

@Test
public void testExecuteAndPostProcessConstSumOption() {
    DataBundle dataBundle = loadDataBundle("/FeedbackSessionQuestionTypeTest.json");
    removeAndRestoreDataBundle(dataBundle);
    InstructorAttributes instructor1ofCourse1 = dataBundle.instructors.get("instructor1OfCourse1");
    gaeSimulation.loginAsInstructor(instructor1ofCourse1.googleId);
    FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("constSumSession");
    FeedbackQuestionAttributes fq = FeedbackQuestionsLogic.inst().getFeedbackQuestion(fs.getFeedbackSessionName(), fs.getCourseId(), 1);
    FeedbackResponsesDb frDb = new FeedbackResponsesDb();
    ______TS("Edit text");
    // There are already responses for this question
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    String[] editTextParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, fq.recipientType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONSTSUM", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "Split points among the options.(edited)", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTS, "100", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHOPTION, "50", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHRECIPIENT, "30", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSPEROPTION, "false", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, "3", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMOPTION + "-0", "Grades", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMOPTION + "-1", "Fun", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMTORECIPIENTS, "false", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    InstructorFeedbackQuestionEditAction a = getAction(editTextParams);
    RedirectResult r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONSTSUM+Session", "FSQTT.idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    // All existing responses should remain
    assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
    ______TS("Edit points");
    String[] editPointsParams = { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_GIVERTYPE, fq.giverType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_RECIPIENTTYPE, fq.recipientType.toString(), Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, Integer.toString(fq.questionNumber), Const.ParamsNames.FEEDBACK_QUESTION_TYPE, "CONSTSUM", Const.ParamsNames.FEEDBACK_QUESTION_TEXT, "Split points among the options.(edited)", Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION, "more details", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTS, "1000", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHOPTION, "300", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSFOREACHRECIPIENT, "500", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMPOINTSPEROPTION, "false", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, "3", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMOPTION + "-0", "Grades", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMOPTION + "-1", "Fun", Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMTORECIPIENTS, "false", Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE, "max", Const.ParamsNames.FEEDBACK_QUESTION_SHOWRESPONSESTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWGIVERTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_SHOWRECIPIENTTO, FeedbackParticipantType.INSTRUCTORS.toString(), Const.ParamsNames.FEEDBACK_QUESTION_EDITTYPE, "edit", Const.ParamsNames.FEEDBACK_QUESTION_ID, fq.getId() };
    a = getAction(editPointsParams);
    r = getRedirectResult(a);
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_PAGE, "FSQTT.idOfTypicalCourse1", "CONSTSUM+Session", "FSQTT.idOfInstructor1OfCourse1", false), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, r.getStatusMessage());
    assertFalse(r.isError);
    // All existing responses should be deleted as the options are edited
    assertTrue(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty());
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackQuestionEditAction(teammates.ui.controller.InstructorFeedbackQuestionEditAction) DataBundle(teammates.common.datatransfer.DataBundle) RedirectResult(teammates.ui.controller.RedirectResult) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) FeedbackResponsesDb(teammates.storage.api.FeedbackResponsesDb) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Example 15 with RedirectResult

use of teammates.ui.controller.RedirectResult in project teammates by TEAMMATES.

the class InstructorFeedbackRemindParticularStudentsActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    InstructorAttributes instructor1ofCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
    FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1");
    StudentAttributes studentNotSubmitFeedback = typicalBundle.students.get("student5InCourse1");
    gaeSimulation.loginAsInstructor(instructor1ofCourse1.googleId);
    ______TS("Unsuccessful case: Not enough parameters");
    String[] paramsNoCourseId = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getSessionName() };
    verifyAssumptionFailure(paramsNoCourseId);
    String[] paramsNoFeedback = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId() };
    verifyAssumptionFailure(paramsNoFeedback);
    ______TS("Unsuccessful case: No user to remind, warning message generated");
    String[] paramsNoUserToRemind = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getSessionName() };
    InstructorFeedbackRemindParticularStudentsAction action = getAction(paramsNoUserToRemind);
    RedirectResult rr = getRedirectResult(action);
    assertTrue(rr.getStatusMessage().contains(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT));
    verifyNoTasksAdded(action);
    ______TS("Unsuccessful case: Feedback session not open, warning message generated");
    fs = typicalBundle.feedbackSessions.get("awaiting.session");
    String[] paramsFeedbackSessionNotOpen = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getSessionName(), Const.ParamsNames.SUBMISSION_REMIND_USERLIST, studentNotSubmitFeedback.getEmail() };
    action = getAction(paramsFeedbackSessionNotOpen);
    rr = getRedirectResult(action);
    assertTrue(rr.getStatusMessage().contains(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSESSIONNOTOPEN));
    verifyNoTasksAdded(action);
    ______TS("Successful case: Typical case");
    fs = typicalBundle.feedbackSessions.get("session1InCourse1");
    String[] paramsTypical = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getSessionName(), Const.ParamsNames.SUBMISSION_REMIND_USERLIST, studentNotSubmitFeedback.getEmail() };
    action = getAction(paramsTypical);
    rr = getRedirectResult(action);
    assertTrue(rr.getStatusMessage().contains(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT));
    verifySpecifiedTasksAdded(action, TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_QUEUE_NAME, 1);
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackRemindParticularStudentsAction(teammates.ui.controller.InstructorFeedbackRemindParticularStudentsAction) RedirectResult(teammates.ui.controller.RedirectResult) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Aggregations

RedirectResult (teammates.ui.controller.RedirectResult)68 Test (org.testng.annotations.Test)49 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)46 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)27 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)17 FeedbackResponsesDb (teammates.storage.api.FeedbackResponsesDb)15 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)12 NullPostParameterException (teammates.common.exception.NullPostParameterException)10 ShowPageResult (teammates.ui.controller.ShowPageResult)10 DataBundle (teammates.common.datatransfer.DataBundle)9 StudentProfilePictureEditAction (teammates.ui.controller.StudentProfilePictureEditAction)9 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)8 FeedbackQuestionsDb (teammates.storage.api.FeedbackQuestionsDb)8 InstructorFeedbackQuestionAddAction (teammates.ui.controller.InstructorFeedbackQuestionAddAction)8 InstructorFeedbackQuestionEditAction (teammates.ui.controller.InstructorFeedbackQuestionEditAction)8 StudentProfileAttributes (teammates.common.datatransfer.attributes.StudentProfileAttributes)5 FeedbackSessionsDb (teammates.storage.api.FeedbackSessionsDb)5 AccountAttributes (teammates.common.datatransfer.attributes.AccountAttributes)4 UnauthorizedAccessException (teammates.common.exception.UnauthorizedAccessException)4 TaskWrapper (teammates.common.util.TaskWrapper)4