Skip to content

Commit

Permalink
Merge pull request #906 from hazendaz/thorough-cleanup
Browse files Browse the repository at this point in the history
[tests] Make sarif not use 'def'
  • Loading branch information
hazendaz authored Oct 21, 2024
2 parents 951fa17 + b8bb6c7 commit 4153a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/it/sarif-1/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2023 the original author or authors.
* Copyright 2005-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,6 @@
* limitations under the License.
*/
import groovy.json.JsonSlurper
import groovy.xml.slurpersupport.GPathResult;

File spotbugSarifFile = new File(basedir, 'target/spotbugsSarif.json')
assert spotbugSarifFile.exists()
Expand All @@ -23,9 +22,9 @@ println '*******************'
println 'Checking SARIF file'
println '*******************'

def path = new JsonSlurper().parse(spotbugSarifFile)
Map path = new JsonSlurper().parse(spotbugSarifFile)

def results = path.runs.results[0]
List results = path.runs.results[0]
println "BugInstance size is ${results.size()}"

assert results.size() > 0
4 changes: 2 additions & 2 deletions src/it/sarif-2/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ String normalizePath(String path) {
return path.replaceAll("\\\\","/");
}

def slurpedResult = new JsonSlurper().parse(spotbugSarifFile)
Map slurpedResult = new JsonSlurper().parse(spotbugSarifFile)

def results = slurpedResult.runs.results[0]
List results = slurpedResult.runs.results[0]

for (result in results) {
for (loc in result.locations) {
Expand Down

0 comments on commit 4153a5f

Please sign in to comment.