From b0fc86100ec63bd1ef2ffdd07444aefe28b22e74 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Fri, 6 Sep 2024 16:13:26 +0200 Subject: [PATCH] refactor(model): Inline some default parameters in a test function Make the code more compact as the comments do not add much value, and the variables were named inconsistently anyway. Signed-off-by: Sebastian Schuberth --- model/src/test/kotlin/AdvisorResultTest.kt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/model/src/test/kotlin/AdvisorResultTest.kt b/model/src/test/kotlin/AdvisorResultTest.kt index d2a99928bea8..3411d214f29c 100644 --- a/model/src/test/kotlin/AdvisorResultTest.kt +++ b/model/src/test/kotlin/AdvisorResultTest.kt @@ -277,15 +277,6 @@ class AdvisorResultTest : WordSpec({ } }) -/** The prefix for URIs pointing to the source of vulnerabilities. */ -private const val SOURCE_URI_PREFIX = "http://cve.mitre.org/cgi-bin/cvename.cgi?name=" - -/** A scoring system used by vulnerabilities. */ -private const val SCORING_SYSTEM = "cvssv3.1_qr" - -/** The default severity assigned to vulnerabilities. */ -private const val DEFAULT_SEVERITY = "MODERATE" - /** Test package identifiers. */ private val langId = Identifier("Maven", "org.apache.commons", "commons-lang3", "3.8") private val queryId = Identifier("NPM", "", "jQuery", "2.1.4") @@ -296,9 +287,9 @@ private val queryId = Identifier("NPM", "", "jQuery", "2.1.4") */ private fun createVulnerability( id: String, - uriPrefix: String = SOURCE_URI_PREFIX, - scoringSystem: String = SCORING_SYSTEM, - severity: String = DEFAULT_SEVERITY + uriPrefix: String = "http://cve.mitre.org/cgi-bin/cvename.cgi?name=", + scoringSystem: String = "cvssv3.1_qr", + severity: String = "MODERATE" ): Vulnerability = Vulnerability( id = id,