Search in sources :

Example 1 with FeedbackSessionUnpublishedEmailWorkerAction

use of teammates.ui.automated.FeedbackSessionUnpublishedEmailWorkerAction in project teammates by TEAMMATES.

the class FeedbackSessionUnpublishedEmailWorkerActionTest method allTests.

@Test
public void allTests() {
    FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1");
    String[] submissionParams = new String[] { ParamsNames.EMAIL_COURSE, session1.getCourseId(), ParamsNames.EMAIL_FEEDBACK, session1.getFeedbackSessionName() };
    FeedbackSessionUnpublishedEmailWorkerAction action = getAction(submissionParams);
    action.execute();
    // 5 students and 5 instructors in course1
    verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 10);
    String courseName = coursesLogic.getCourse(session1.getCourseId()).getName();
    List<TaskWrapper> tasksAdded = action.getTaskQueuer().getTasksAdded();
    for (TaskWrapper task : tasksAdded) {
        Map<String, String[]> paramMap = task.getParamMap();
        assertEquals(String.format(EmailType.FEEDBACK_UNPUBLISHED.getSubject(), courseName, session1.getSessionName()), paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]);
    }
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) TaskWrapper(teammates.common.util.TaskWrapper) FeedbackSessionUnpublishedEmailWorkerAction(teammates.ui.automated.FeedbackSessionUnpublishedEmailWorkerAction) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 TaskWrapper (teammates.common.util.TaskWrapper)1 FeedbackSessionUnpublishedEmailWorkerAction (teammates.ui.automated.FeedbackSessionUnpublishedEmailWorkerAction)1