Skip to content

Commit d968db5

Browse files
wkl3nkoheger-bosch
authored andcommitted
fix(fossid-webapp): Ignore duplicate rule creation
A previous change (commit 306135b) was not effective because a dot was missing at the end of the expected error message. Add this dot to the code and the test case to make this fix effective. Signed-off-by: klw1imb <[email protected]>
1 parent fad569b commit d968db5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/scanners/fossid/src/main/kotlin/events/CloneRepositoryHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class CloneRepositoryHandler(val config: FossIdConfig, val service: FossIdServic
162162
)
163163
// It could be that global rules are automatically added to a scan. Therefore, a failure in creation
164164
// because of duplication should be ignored.
165-
if (response.error != "Rule already exists") {
165+
if (response.error != "Rule already exists.") {
166166
response.checkResponse("create ignore rules", false)
167167

168168
logger.info {

plugins/scanners/fossid/src/test/kotlin/TestUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ internal fun FossIdServiceWithVersion.expectCreateIgnoreRule(
556556
): FossIdServiceWithVersion {
557557
if (error) {
558558
coEvery { createIgnoreRule(USER, API_KEY, scanCode, type, value, scope) } returns
559-
EntityResponseBody("create ignore rules", error = "Rule already exists")
559+
EntityResponseBody("create ignore rules", error = "Rule already exists.")
560560
} else {
561561
coEvery { createIgnoreRule(USER, API_KEY, scanCode, type, value, scope) } returns EntityResponseBody()
562562
}

0 commit comments

Comments
 (0)