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 {}
Please sign in to leave a comment.
The solution here was to move the test class files into the correct package directory structure: