Closed
Description
Describe the bug
I have a working test with a DefaultParameterTransformer (using Jackson). When I run this test in IntelliJ it succeeds. Although when running with Surefire, the test fails.
Output with Intellij:
Mapping '1.1.0' to 'java.lang.String'.
We wants a version: 1.1.0
Mapping '1.1.0' to 'nl.blue4it.stolwijk.sandbox.cucumber5.model.Version'.
We gets a version: Version{major=1, minor=1, patch=0}
1 Scenarios (1 passed)
2 Steps (2 passed)
0m0,513s
Output with Surefire:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running Version number check
Mapping '1.1.0' to 'java.lang.Object'.
We wants a version: 1.1.0
Mapping '1.1.0' to 'java.lang.Object'.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.422 s <<< FAILURE! - in Version number check
[ERROR] User wants to use 1.1.0 as version. Time elapsed: 0.416 s <<< ERROR!
java.lang.ClassCastException: class java.lang.String cannot be cast to class nl.blue4it.stolwijk.sandbox.cucumber5.model.Version (java.lang.String is in module java.base of loader 'bootstrap'; nl.blue4it.stolwijk.sandbox.cucumber5.model.Version is in unna
med module of loader 'app')
To Reproduce
Steps to reproduce the behavior:
- Clone the repository at 'https://github.com/nickstolwijk/cucumber-platformengine-surefire-issue'
- Run
mvn verify
- See the build fail.
- Import into IDE.
- Run feature
- See the feature succeed
Expected behavior
The feature should succeed both in Surefire as in IntelliJ.
Your Environment
- Cucumber version 5.0.0 RC2
- Operating System and version: Windows 10
- IntelliJ 2019.3
- Build tool: Maven 3.6.3
- Java: OpenJDK 11.0.2