use of teammates.ui.automated.FeedbackResponseAdjustmentWorkerAction in project teammates by TEAMMATES.
the class FeedbackResponseAdjustmentWorkerActionTest method allTests.
@Test
public void allTests() throws Exception {
______TS("typical case : existing student changes team");
FeedbackSessionAttributes session = dataBundle.feedbackSessions.get("session2InCourse1");
StudentAttributes student = dataBundle.students.get("student1InCourse1");
// Verify pre-existing submissions and responses
List<FeedbackResponseAttributes> oldResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName());
assertFalse(oldResponsesForSession.isEmpty());
String oldTeam = student.team;
String oldSection = student.section;
String newTeam = "Team 1.2";
String newSection = "Section 2";
student.team = newTeam;
student.section = newSection;
StudentEnrollDetails enrollDetails = new StudentEnrollDetails(StudentUpdateStatus.MODIFIED, student.course, student.email, oldTeam, newTeam, oldSection, newSection);
List<StudentEnrollDetails> enrollList = new ArrayList<>();
enrollList.add(enrollDetails);
studentsLogic.updateStudentCascadeWithSubmissionAdjustmentScheduled(student.email, student, false);
String[] submissionParams = new String[] { ParamsNames.COURSE_ID, student.course, ParamsNames.FEEDBACK_SESSION_NAME, session.getFeedbackSessionName(), ParamsNames.ENROLLMENT_DETAILS, JsonUtils.toJson(enrollList) };
FeedbackResponseAdjustmentWorkerAction action = getAction(submissionParams);
action.execute();
List<FeedbackResponseAttributes> newResponsesForSession = getAllResponsesForStudentForSession(student, session.getFeedbackSessionName());
assertTrue(newResponsesForSession.isEmpty());
}
Aggregations