All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hr.fer.junit.grading.TestsWithoutTestGroupInGradingMatrixException Maven / Gradle / Ivy

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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy