-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spring, Kotlin] Kotlin Metadata annotations breaks SpringFactory #1240
Comments
The proposed solution works but over time has the potential to explode into a list of exceptions. This is undesirable. I think we should improve the solution to the underlying issue. I'd have to study #711 to see if it would be possible to limit the number of step definition annotated with As a work around I'd either suggest manually ensuring there is only one step definition annotated by |
@mpkorstanje It is absolutely possible to limit the number of glue classes annotated with |
Deprecating it now and adding a ticket to the 3.0.0 mile stone should do it then. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
kotlin-spring does not work together with Kotlin Step classes
Expected Behavior
Given Two different Kotlin Steps definition classes like
When A scenario is executed using this step class as glue code
Then The scenario is executed without an error
Current Behavior
An exception is thrown:
cucumber.runtime.CucumberException: Annotations differs on glue classes found: com.xxx.SomeSteps1, com.xxx.SomeSteps2
Background: Kotlin adds an additonal Annotation
kotlin.Metadata
to each class. These Metadata differ for each class, therefore the check in SpringFactory.checkAnnotationsEqual() fails.Possible Solution
Before comparing the annotations, remove annotations of type
kotlin.Metadata
(can be done by its name so there is no dependency to Kotlin)Steps to Reproduce (for bugs)
(see above in Expected behaviour)
Context & Motivation
We use in our project Cucumber with Spring and Java for a while and I tried out to add a Kotlin step definition class, which did not work out that good...
Your Environment
The text was updated successfully, but these errors were encountered: