PsiClass.superclass returns null in LightCodeInsightFixtureTestCase

I'm trying to understand why the assertion in the following test fails:

 

class TmpTest : LightCodeInsightFixtureTestCase() {

fun test() {
myFixture.configureByFiles("Child.java", "Parent.java")

val childClass = myFixture.findClass("test.Child")
assertThat(childClass.superClass).isNotNull()
}

override fun getTestDataPath(): String {
return "src/test/resources"
}
}

The child file looks like this:

package test;

class Child extends Parent {}
1 comment
Comment actions Permalink

The solution here was to move the test class files into the correct package directory structure:

myFixture.configureByFiles("test/Child.java", "test/Parent.java")
0

Please sign in to leave a comment.