Skip to content

Commit 7c8d3ec

Browse files
committedFeb 11, 2025
test(model): Move a function to the top level for consistency
Signed-off-by: Frank Viernau <x9fviern@zeiss.com>
1 parent 4391f15 commit 7c8d3ec

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
 

‎model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import org.ossreviewtoolkit.model.config.LicenseFindingCuration
5454
import org.ossreviewtoolkit.model.config.LicenseFindingCurationReason
5555
import org.ossreviewtoolkit.model.config.PathExclude
5656
import org.ossreviewtoolkit.model.config.PathExcludeReason
57-
import org.ossreviewtoolkit.model.licenses.TestUtils.containLicensesExactly
5857
import org.ossreviewtoolkit.model.utils.FileArchiver
5958
import org.ossreviewtoolkit.model.utils.FileProvenanceFileStorage
6059
import org.ossreviewtoolkit.utils.ort.DeclaredLicenseProcessor

‎model/src/test/kotlin/licenses/ResolvedLicenseInfoTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import io.mockk.mockk
2727

2828
import org.ossreviewtoolkit.model.Identifier
2929
import org.ossreviewtoolkit.model.LicenseSource
30-
import org.ossreviewtoolkit.model.licenses.TestUtils.containLicensesExactly
3130
import org.ossreviewtoolkit.utils.spdx.SpdxLicenseChoice
3231
import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression
3332
import org.ossreviewtoolkit.utils.spdx.toSpdx

‎model/src/test/kotlin/licenses/TestUtils.kt

+6-8
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ import io.kotest.matchers.neverNullMatcher
2626
import org.ossreviewtoolkit.utils.spdx.SpdxExpression
2727
import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression
2828

29-
object TestUtils {
30-
fun containLicensesExactly(vararg licenses: String): Matcher<Iterable<ResolvedLicense>?> =
31-
neverNullMatcher { value ->
32-
val expected = licenses.map { SpdxExpression.parse(it) as SpdxSingleLicenseExpression }.toSet()
33-
val actual = value.map { it.license }.toSet()
29+
fun containLicensesExactly(vararg licenses: String): Matcher<Iterable<ResolvedLicense>?> =
30+
neverNullMatcher { value ->
31+
val expected = licenses.map { SpdxExpression.parse(it) as SpdxSingleLicenseExpression }.toSet()
32+
val actual = value.map { it.license }.toSet()
3433

35-
containExactly(expected).test(actual)
36-
}
37-
}
34+
containExactly(expected).test(actual)
35+
}

0 commit comments

Comments
 (0)
Please sign in to comment.