Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.1
-
None
Description
Junit5 fails to process closures as annotation member values in package-info.groovy. This worked in Groovy 2.5 / Junit4
Caused by: java.lang.IncompatibleClassChangeError: io.micronaut.inject.configurations.requirescondition.package-info and io.micronaut.inject.configurations.requirescondition.package-info$_closure1 disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at java.lang.Class.getEnclosingClass(Class.java:1277) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79) at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
The package info is related to Micronaut.
@Configuration @Requires(condition = { ConditionContext context -> true }) package io.micronaut.inject.configurations.requirescondition2 import io.micronaut.context.annotation.Configuration import io.micronaut.context.annotation.Requires import io.micronaut.context.condition.ConditionContext
I'll try to create a sample application here shortly.
I was able to work around the issue by adding:
test {
exclude '***/*$_closure*'
}
to my build.gradle.
Attachments
Issue Links
- is related to
-
GROOVY-10121 @AnnotationCollector does not work with JUnit 5
- Closed