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";
|
public static final String FILL_OUT_REPORT = "fillOutReport";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private FinalSeminarOppositionRepo finalSeminarOppositionRepo;
|
private FinalSeminarOppositionService finalSeminarOppositionService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OppositionReportService oppositionReportService;
|
private OppositionReportService oppositionReportService;
|
||||||
@ -35,7 +35,7 @@ public class OppositionReportPage extends AbstractProjectDetailsPage implements
|
|||||||
throw new RestartResponseException(ProjectDetailsPage.class, pp);
|
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) {
|
if (opposition == null) {
|
||||||
throw new RestartResponseException(ProjectDetailsPage.class, pp);
|
throw new RestartResponseException(ProjectDetailsPage.class, pp);
|
||||||
|
@ -321,9 +321,6 @@ public abstract class SciProTest {
|
|||||||
@Mock
|
@Mock
|
||||||
protected FinalSeminarUploadController finalSeminarUploadController;
|
protected FinalSeminarUploadController finalSeminarUploadController;
|
||||||
|
|
||||||
@Mock
|
|
||||||
protected FinalSeminarOppositionRepo finalSeminarOppositionRepo;
|
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
protected PlagiarismControl plagiarismControl;
|
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() {
|
public void disable_form_if_opposition_does_not_belong_to_logged_in_user() {
|
||||||
mockReport(bachelor);
|
mockReport(bachelor);
|
||||||
long oppositionId = 4L;
|
long oppositionId = 4L;
|
||||||
Mockito.when(finalSeminarOppositionRepo.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
Mockito.when(finalSeminarOppositionService.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||||
startPage(oppositionId);
|
startPage(oppositionId);
|
||||||
tester.assertDisabled(FILL_OUT_REPORT);
|
tester.assertDisabled(FILL_OUT_REPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void redirect_if_no_opposition_is_found_from_id() {
|
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);
|
startPage(1L);
|
||||||
tester.assertRenderedPage(ProjectDetailsPage.class);
|
tester.assertRenderedPage(ProjectDetailsPage.class);
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ public class OppositionReportPageTest extends SciProTest {
|
|||||||
private void startOppositionPage() {
|
private void startOppositionPage() {
|
||||||
long oppositionId = 4L;
|
long oppositionId = 4L;
|
||||||
setLoggedInAs(user);
|
setLoggedInAs(user);
|
||||||
Mockito.when(finalSeminarOppositionRepo.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
Mockito.when(finalSeminarOppositionService.findOne(oppositionId)).thenReturn(finalSeminarOpposition);
|
||||||
startPage(oppositionId);
|
startPage(oppositionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user