Skip to content

Commit

Permalink
test(osv): Fix the assertion for ecosystem support
Browse files Browse the repository at this point in the history
The previous assertion would have passed for a packages for which
either the ecosystem is not supported or for which no vulnerability is
returned.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 10, 2023
1 parent 65125cb commit a702a3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/advisors/osv/src/funTest/kotlin/OsvFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
package org.ossreviewtoolkit.plugins.advisors.osv

import io.kotest.core.spec.style.StringSpec
import io.kotest.inspectors.forAll
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNot

import java.time.Instant

Expand Down Expand Up @@ -52,6 +55,9 @@ class OsvFunTest : StringSpec({
val packageFindings = osv.retrievePackageFindings(packages)

packageFindings.keys shouldContainExactlyInAnyOrder packages
packageFindings.keys.forAll { pkg ->
packageFindings.getValue(pkg).vulnerabilities shouldNot beEmpty()
}
}

"retrievePackageFindings() returns the expected result for the given package(s)" {
Expand Down

0 comments on commit a702a3c

Please sign in to comment.