Skip to content

Commit

Permalink
test(osv): Rename patchFields()
Browse files Browse the repository at this point in the history
The function actually does two things, patching ignorable fields and
normalize this. So, rename the function to just `patch()` so that it
better fits also the normalization and uses a shorter name.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Jan 17, 2025
1 parent 78edc76 commit dcd71a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/osv/src/funTest/kotlin/OsvServiceWrapperFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private fun Vulnerability.normalizeUrls(): Vulnerability {

private val emptyJsonObject = JsonObject(emptyMap())

private fun List<Vulnerability>.patchFields() = map { it.patchIgnorableFields().normalizeUrls() }
private fun List<Vulnerability>.patch() = map { it.patchIgnorableFields().normalizeUrls() }

class OsvServiceWrapperFunTest : StringSpec({
"getVulnerabilitiesForPackage() returns the expected vulnerability when queried by commit" {
Expand All @@ -70,7 +70,7 @@ class OsvServiceWrapperFunTest : StringSpec({

result.shouldBeSuccess { actualData ->
val expectedData = OsvService.JSON.decodeFromString<List<Vulnerability>>(expectedResult)
actualData.patchFields() shouldContainExactlyInAnyOrder expectedData.patchFields()
actualData.patch() shouldContainExactlyInAnyOrder expectedData.patch()
}
}

Expand All @@ -81,7 +81,7 @@ class OsvServiceWrapperFunTest : StringSpec({

result.shouldBeSuccess { actualData ->
val expectedData = OsvService.JSON.decodeFromString<List<Vulnerability>>(expectedResult)
actualData.patchFields() shouldContainExactlyInAnyOrder expectedData.patchFields()
actualData.patch() shouldContainExactlyInAnyOrder expectedData.patch()
}
}

Expand Down

0 comments on commit dcd71a5

Please sign in to comment.