use of de.tum.in.www1.artemis.domain.Team in project Artemis by ls1intum.
the class TeamWebsocketServiceTest method testSendTeamAssignmentUpdateOnAddStudentToTeam.
@Test
@WithMockUser(username = "tutor1", roles = "TA")
void testSendTeamAssignmentUpdateOnAddStudentToTeam() throws Exception {
Team team = new Team().name("Team").shortName("team").exercise(modelingExercise);
team = request.postWithResponseBody(teamResourceUrl(), team, Team.class, HttpStatus.CREATED);
Team updatedTeam = new Team(team).id(team.getId()).students(students);
updatedTeam = request.putWithResponseBody(teamResourceUrl() + "/" + updatedTeam.getId(), updatedTeam, Team.class, HttpStatus.OK);
TeamAssignmentPayload expectedPayload = new TeamAssignmentPayload(modelingExercise, updatedTeam);
team.getStudents().forEach(user -> verify(messagingTemplate).convertAndSendToUser(user.getLogin(), assignmentTopic, expectedPayload));
}
Aggregations