WIP: Allow supervisors to request improvements from final seminar opponents #78
@ -6,9 +6,12 @@ import jakarta.inject.Inject;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Month;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.report.AbstractGradingCriterion;
|
||||
import se.su.dsv.scipro.report.GradingCriterionPointTemplate;
|
||||
import se.su.dsv.scipro.report.GradingReportTemplate;
|
||||
import se.su.dsv.scipro.report.OppositionReport;
|
||||
import se.su.dsv.scipro.system.DegreeType;
|
||||
@ -46,6 +49,28 @@ public class FinalSeminarOppositionServiceImplIntegrationTest extends Integratio
|
||||
assertEquals(0, finalSeminarOppositionService.count());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void opposition_criteria_are_taken_from_the_grading_report_template() {
|
||||
FinalSeminarOpposition opposition = createOpposition(finalSeminar, createUser());
|
||||
GradingReportTemplate gradingReportTemplate = createGradingReportTemplate();
|
||||
|
||||
GradingCriterionPointTemplate failingCriterion = new GradingCriterionPointTemplate();
|
||||
failingCriterion.setPoint(0);
|
||||
GradingCriterionPointTemplate passingCriterion = new GradingCriterionPointTemplate();
|
||||
passingCriterion.setPoint(1);
|
||||
|
||||
gradingReportTemplate.addIndividualCriterion(
|
||||
"Criterion 1",
|
||||
"Criterion 1",
|
||||
1,
|
||||
List.of(failingCriterion, passingCriterion),
|
||||
AbstractGradingCriterion.Flag.OPPOSITION
|
||||
);
|
||||
save(gradingReportTemplate);
|
||||
|
||||
assertEquals(2, finalSeminarOppositionService.getCriteriaForOpposition(opposition).size());
|
||||
}
|
||||
|
||||
private void createOppositionReport(FinalSeminarOpposition opposition) {
|
||||
OppositionReport report = new OppositionReport(createGradingReportTemplate(), opposition);
|
||||
opposition.setOppositionReport(report);
|
||||
|
Loading…
x
Reference in New Issue
Block a user