Test verifying project type validation on author idea selection

This commit is contained in:
Andreas Svanberg 2025-03-05 14:11:03 +01:00
parent 23e0a7f5ea
commit 2842b64302

@ -401,6 +401,17 @@ public class IdeaServiceImplTest {
assertEquals(expected, ideaService.countAuthorsByApplicationPeriod(applicationPeriod, params));
}
@Test
public void wrong_type_for_author() {
when(applicationPeriodService.getTypesForStudent(applicationPeriod, student)).thenReturn(List.of(master));
assertPair(
false,
"The idea is the wrong level for you, please pick another one.",
ideaService.validateStudentAcceptance(createBachelorIdea(Idea.Status.UNMATCHED), student, coAuthor, applicationPeriod)
);
}
private Idea mockInactiveIdea() {
Idea idea = new Idea();
Match match = new Match();