Package org.ossreviewtoolkit.utils.test
Class MatchersKt
-
- All Implemented Interfaces:
public final class MatchersKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any, U extends Any> Matcher<T>transformingCollectionMatcher(Collection<U> expected, Function1<Collection<U>, Matcher<Collection<U>>> matcher, Function1<T, Collection<U>> transform)A helper function to create a custom matcher that compares an expected collection to a collection obtained by transform using the provided matcher. final static <T extends Any, U extends Any> Matcher<T>transformingCollectionEmptyMatcher(Function1<T, Collection<U>> transform)A helper function to create custom matchers that assert that the collection obtained by transform is empty. final static Matcher<String>matchExpectedResult(File expectedResultFile, File definitionFile, Map<String, String> custom, Integer contextSize)A matcher for comparing to expected result files, in particular serialized ProjectAnalyzerResults and OrtResults, that displays a unified diff with the given contextSize if the results do not match. -
-
Method Detail
-
transformingCollectionMatcher
final static <T extends Any, U extends Any> Matcher<T> transformingCollectionMatcher(Collection<U> expected, Function1<Collection<U>, Matcher<Collection<U>>> matcher, Function1<T, Collection<U>> transform)
A helper function to create a custom matcher that compares an expected collection to a collection obtained by transform using the provided matcher.
-
transformingCollectionEmptyMatcher
final static <T extends Any, U extends Any> Matcher<T> transformingCollectionEmptyMatcher(Function1<T, Collection<U>> transform)
A helper function to create custom matchers that assert that the collection obtained by transform is empty.
-
matchExpectedResult
final static Matcher<String> matchExpectedResult(File expectedResultFile, File definitionFile, Map<String, String> custom, Integer contextSize)
A matcher for comparing to expected result files, in particular serialized ProjectAnalyzerResults and OrtResults, that displays a unified diff with the given contextSize if the results do not match. If the Kotest system property named "kotest.assertions.multi-line-diff" is set to "simple", this just falls back to equalityMatcher.
-
-
-
-