hr.fer.junit.grading.TestsWithoutTestGroupInGradingMatrixException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit-grading Show documentation
Show all versions of junit-grading Show documentation
Testing library to run with grading student examination.
The newest version!
package hr.fer.junit.grading;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.stream.Collectors;
public class TestsWithoutTestGroupInGradingMatrixException extends RuntimeException {
private List tests;
public TestsWithoutTestGroupInGradingMatrixException(List testsWithMissingTestGroupInGradingMatrix) {
super("Missing testGroups: " + collectTestGroups(testsWithMissingTestGroupInGradingMatrix));
this.tests = testsWithMissingTestGroupInGradingMatrix;
}
private static String collectTestGroups(List testsWithMissingTestGroupInGradingMatrix) {
return new LinkedHashSet<>(testsWithMissingTestGroupInGradingMatrix.stream()
.map(tgi -> tgi.testGroup())
.toList())
.stream()
.collect(Collectors.joining(", "));
}
public List getTests() {
return tests;
}
}