Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62ef1fe

Browse files
committed
Fix type issue in SBOM integration test
1 parent d6697e5 commit 62ef1fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/SBOMFunctionalTest.groovy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ class SBOMFunctionalTest extends AbstractGraalVMMavenFunctionalTest {
170170
assert mainComponentDependency.get('dependsOn').isEmpty()
171171
172172
// Check that the main component is not found in "components"
173-
assert !rootNode.get('components').any { it.get('bom-ref').asText() == mainComponentId }
173+
assert !rootNode.get('components').any { component ->
174+
def bomRef = component.get('bom-ref')
175+
if (!bomRef) {
176+
return false
177+
}
178+
def bomRefValue = bomRef instanceof String ? bomRef : bomRef.asText()
179+
bomRefValue == mainComponentId
180+
}
174181
175182
return true
176183
} catch (AssertionError | Exception e) {

0 commit comments

Comments
 (0)