File tree 2 files changed +8
-7
lines changed
model/src/test/kotlin/licenses
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -726,13 +726,6 @@ private fun createLicenseInfo(
726
726
)
727
727
)
728
728
729
- private class SimpleLicenseInfoProvider (licenseInfo : List <LicenseInfo >) : LicenseInfoProvider {
730
- private val licenseInfoById = licenseInfo.associateBy { it.id }
731
-
732
- override fun get (id : Identifier ) =
733
- licenseInfoById[id] ? : throw IllegalArgumentException (" No license info for '${id.toCoordinates()} ' available." )
734
- }
735
-
736
729
private fun Map <String , List <TextLocation >>.toFindingsSet (): Set <LicenseFinding > =
737
730
flatMap { (license, locations) ->
738
731
locations.map { LicenseFinding (license, it) }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import io.kotest.matchers.Matcher
23
23
import io.kotest.matchers.collections.containExactly
24
24
import io.kotest.matchers.neverNullMatcher
25
25
26
+ import org.ossreviewtoolkit.model.Identifier
26
27
import org.ossreviewtoolkit.utils.spdx.SpdxExpression
27
28
import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression
28
29
@@ -33,3 +34,10 @@ fun containLicensesExactly(vararg licenses: String): Matcher<Iterable<ResolvedLi
33
34
34
35
containExactly(expected).test(actual)
35
36
}
37
+
38
+ class SimpleLicenseInfoProvider (licenseInfo : List <LicenseInfo >) : LicenseInfoProvider {
39
+ private val licenseInfoById = licenseInfo.associateBy { it.id }
40
+
41
+ override fun get (id : Identifier ) =
42
+ licenseInfoById[id] ? : throw IllegalArgumentException (" No license info for '${id.toCoordinates()} ' available." )
43
+ }
You can’t perform that action at this time.
0 commit comments