diff --git a/cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StaticImportsTest.kt b/cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StaticImportsTest.kt index 0def824fc99..a6105cf0afa 100644 --- a/cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StaticImportsTest.kt +++ b/cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StaticImportsTest.kt @@ -117,12 +117,12 @@ internal class StaticImportsTest : BaseTest() { assertTrue(staticField.modifiers.contains("static")) assertFalse(nonStaticField.modifiers.contains("static")) - val declaredReferences = main.allChildren() + val declaredReferences = main.refs val usage = findByUniqueName(declaredReferences, "staticField") - assertEquals(staticField, usage.refersTo) + assertRefersTo(usage, staticField) val nonStatic = findByUniqueName(declaredReferences, "nonStaticField") - assertNotEquals(nonStaticField, nonStatic.refersTo) + assertRefersTo(nonStatic, nonStaticField) assertTrue(nonStatic.refersTo!!.isInferred) } }