3262 Improve feedback when students select a supervisor idea

This commit is contained in:
Andreas Svanberg 2024-04-03 14:55:47 +02:00
parent cabdc5bfce
commit a76ff3db2a
2 changed files with 8 additions and 3 deletions
core/src
main/java/se/su/dsv/scipro/match
test/java/se/su/dsv/scipro/match

@ -45,7 +45,6 @@ public class IdeaServiceImpl extends AbstractServiceImpl<Idea, Long> implements
public static final String NO_LONGER_AVAILABLE_ERROR = "Idea is no longer available";
public static final String ALREADY_PARTICIPATING_ERROR = "You are already participating in another idea";
public static final String PARTNER_ALREADY_PARTICIPATING_ERROR = "Your partner is already participating in another idea";
public static final String SELECTED_IDEA = "You selected idea: ";
public static final String BACHELOR_NEED_PARTNER_ERROR = "You need to select a partner when the idea is on bachelor level";
public static final String ADD_SELF_AS_PARTNER_ERROR = "You may not add yourself as project partner";
public static final String NO_AUTHORS_ERROR = "The idea is submitted by a student, number of students is not allowed";
@ -217,7 +216,8 @@ public class IdeaServiceImpl extends AbstractServiceImpl<Idea, Long> implements
return new Pair<>(Boolean.FALSE, WRONG_LEVEL_FOR_YOU);
}
return new Pair<>(Boolean.TRUE, SELECTED_IDEA + idea.getTitle());
return new Pair<>(Boolean.TRUE, "You have successfully selected the supervisor idea "
+ idea.getTitle() + ", in the application period " + ap.getName());
}

@ -204,7 +204,12 @@ public class IdeaServiceImplTest {
when(applicationPeriodService.getTypesForStudent(applicationPeriod, student))
.thenReturn(List.of(bachelor));
assertPair(true, SELECTED_IDEA + idea.getTitle(), ideaService.validateStudentAcceptance(idea, student, coAuthor, applicationPeriod));
Pair<Boolean, String> acceptance = ideaService.validateStudentAcceptance(
idea,
student,
coAuthor,
applicationPeriod);
assertTrue(acceptance.getHead());
}
@Test