diff --git a/plugins/junit/kotlin-tests-shared/test/com/intellij/execution/junit/kotlin/codeInspection/KotlinJUnitMalformedDeclarationInspectionTest.kt b/plugins/junit/kotlin-tests-shared/test/com/intellij/execution/junit/kotlin/codeInspection/KotlinJUnitMalformedDeclarationInspectionTest.kt index 8764d60b229a..418f7657703a 100644 --- a/plugins/junit/kotlin-tests-shared/test/com/intellij/execution/junit/kotlin/codeInspection/KotlinJUnitMalformedDeclarationInspectionTest.kt +++ b/plugins/junit/kotlin-tests-shared/test/com/intellij/execution/junit/kotlin/codeInspection/KotlinJUnitMalformedDeclarationInspectionTest.kt @@ -1416,27 +1416,39 @@ abstract class KotlinJUnitMalformedDeclarationInspectionTest : KotlinJUnitMalfor fun beforeAll(foo: String) { println(foo) } } } - - @org.junit.jupiter.api.extension.ExtendWith(MyTest.MyCallback::class) - @CustomTestAnnotation - annotation class MyTest { - class MyCallback : org.junit.jupiter.api.extension.AfterEachCallback { - override fun afterEach(context: org.junit.jupiter.api.extension.ExtensionContext) { - } - } - } - - @MyTest - class MultipleMetaParameterResolver { - companion object { - @JvmStatic - @org.junit.jupiter.api.BeforeAll - fun beforeAll(foo: String) { println(foo) } - } - } """.trimIndent()) } + fun `test nested meta-annotations`() { + myFixture.testHighlighting( + JvmLanguage.KOTLIN, """ + class MyBefore : org.junit.jupiter.api.extension.BeforeEachCallback { + override fun beforeEach(context: org.junit.jupiter.api.extension.ExtensionContext) { + } + } + + @org.junit.jupiter.api.extension.ExtendWith(MyBefore::class) + annotation class CustomTestAnnotation + + @org.junit.jupiter.api.extension.ExtendWith(MyTest.MyCallback::class) + @CustomTestAnnotation + annotation class MyTest { + class MyCallback : org.junit.jupiter.api.extension.AfterEachCallback { + override fun afterEach(context: org.junit.jupiter.api.extension.ExtensionContext) { + } + } + } + + @MyTest + class MultipleMetaParameterResolver { + companion object { + @org.junit.jupiter.api.Test + fun test() { } + } + } + """.trimIndent()) + } + fun `test non-malformed parameter resolver with value source`() { myFixture.testHighlighting( JvmLanguage.KOTLIN, """