WIP: Allow supervisors to request improvements from final seminar opponents #78
@ -24,7 +24,7 @@ public class OppositionReportPage extends AbstractProjectDetailsPage implements
|
||||
public static final String FILL_OUT_REPORT = "fillOutReport";
|
||||
|
||||
@Inject
|
||||
private FinalSeminarOppositionRepo finalSeminarOppositionRepo;
|
||||
private FinalSeminarOppositionService finalSeminarOppositionService;
|
||||
|
||||
@Inject
|
||||
private OppositionReportService oppositionReportService;
|
||||
@ -35,7 +35,7 @@ public class OppositionReportPage extends AbstractProjectDetailsPage implements
|
||||
throw new RestartResponseException(ProjectDetailsPage.class, pp);
|
||||
}
|
||||
|
||||
final FinalSeminarOpposition opposition = finalSeminarOppositionRepo.findOne(pp.get("oid").toLong());
|
||||
final FinalSeminarOpposition opposition = finalSeminarOppositionService.findOne(pp.get("oid").toLong());
|
||||
|
||||
if (opposition == null) {
|
||||
throw new RestartResponseException(ProjectDetailsPage.class, pp);
|
||||
|
@ -321,9 +321,6 @@ public abstract class SciProTest {
|
||||
@Mock
|
||||
protected FinalSeminarUploadController finalSeminarUploadController;
|
||||
|
||||
@Mock
|
||||
protected FinalSeminarOppositionRepo finalSeminarOppositionRepo;
|
||||
|
||||
@Mock
|
||||
protected PlagiarismControl plagiarismControl;
|
||||
|
||||
|
@ -104,14 +104,14 @@ public class OppositionReportPageTest extends SciProTest {
|
||||
public void disable_form_if_opposition_does_not_belong_to_logged_in_user() {
|
||||
mockReport(bachelor);
|
||||
long oppositionId = 4L;
|
||||
Mockito.when(finalSeminarOppositionRepo.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||
Mockito.when(finalSeminarOppositionService.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||
startPage(oppositionId);
|
||||
tester.assertDisabled(FILL_OUT_REPORT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void redirect_if_no_opposition_is_found_from_id() {
|
||||
Mockito.when(finalSeminarOppositionRepo.findOne(ArgumentMatchers.anyLong())).thenReturn(null);
|
||||
Mockito.when(finalSeminarOppositionService.findOne(ArgumentMatchers.anyLong())).thenReturn(null);
|
||||
startPage(1L);
|
||||
tester.assertRenderedPage(ProjectDetailsPage.class);
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class OppositionReportPageTest extends SciProTest {
|
||||
private void startOppositionPage() {
|
||||
long oppositionId = 4L;
|
||||
setLoggedInAs(user);
|
||||
Mockito.when(finalSeminarOppositionRepo.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||
Mockito.when(finalSeminarOppositionService.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||
startPage(oppositionId);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user