Skip to content

Commit

Permalink
FossIdReporterTest: Improve createScanResult()
Browse files Browse the repository at this point in the history
Use named arguments, inline a variable to end up with an expression
function.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Oct 12, 2022
1 parent beef2a5 commit b76e577
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions reporter/src/test/kotlin/reporters/fossid/FossIdReporterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@ private fun createReporterInput(vararg scanCodes: String): ReporterInput {
)
}

private fun createScanResult(scanCode: String): ScanResult {
val summary = ScanSummary(
Instant.now(), Instant.now(), "", sortedSetOf(), sortedSetOf()
private fun createScanResult(scanCode: String): ScanResult =
ScanResult(
provenance = UnknownProvenance,
scanner = ScannerDetails.EMPTY,
summary = ScanSummary(
Instant.now(), Instant.now(), "", sortedSetOf(), sortedSetOf()
),
additionalData = mapOf(FossIdReporter.SCAN_CODE_KEY to scanCode)
)
return ScanResult(UnknownProvenance, ScannerDetails.EMPTY, summary, mapOf(FossIdReporter.SCAN_CODE_KEY to scanCode))
}

0 comments on commit b76e577

Please sign in to comment.