Skip to content

Commit 4153a5f

Browse files
authored
Merge pull request #906 from hazendaz/thorough-cleanup
[tests] Make sarif not use 'def'
2 parents 951fa17 + b8bb6c7 commit 4153a5f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/it/sarif-1/verify.groovy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2005-2023 the original author or authors.
2+
* Copyright 2005-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
import groovy.json.JsonSlurper
17-
import groovy.xml.slurpersupport.GPathResult;
1817

1918
File spotbugSarifFile = new File(basedir, 'target/spotbugsSarif.json')
2019
assert spotbugSarifFile.exists()
@@ -23,9 +22,9 @@ println '*******************'
2322
println 'Checking SARIF file'
2423
println '*******************'
2524

26-
def path = new JsonSlurper().parse(spotbugSarifFile)
25+
Map path = new JsonSlurper().parse(spotbugSarifFile)
2726

28-
def results = path.runs.results[0]
27+
List results = path.runs.results[0]
2928
println "BugInstance size is ${results.size()}"
3029

3130
assert results.size() > 0

src/it/sarif-2/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ String normalizePath(String path) {
2626
return path.replaceAll("\\\\","/");
2727
}
2828

29-
def slurpedResult = new JsonSlurper().parse(spotbugSarifFile)
29+
Map slurpedResult = new JsonSlurper().parse(spotbugSarifFile)
3030

31-
def results = slurpedResult.runs.results[0]
31+
List results = slurpedResult.runs.results[0]
3232

3333
for (result in results) {
3434
for (loc in result.locations) {

0 commit comments

Comments
 (0)