-
-
Notifications
You must be signed in to change notification settings - Fork 2k
class *ClassWithSteps* does not have a public zero-argument constructor #2469
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
Comments
Without executing the reproducer I reckon the assembly plugin is clobbering the Consider adding the |
I will try that and get back to you. I didn't see something about it on 7.1.0 release notes and it wouldn't explain why it doesn't fail with 7.0.0 There is a descriptor file (https://github.com/ralphavalon/cucumber-issue/blob/main/assembly-fat-testjar.xml) but since it doesn't have the |
That would be caused by #2400 which added the I wouldn't really consider building fat-jars part of the public API, but feel free to send a PR that adds a note to the changelog. |
It fixes the issue indeed (consider it closed), which leads me to the (probably dumb) question: if it should be the default object factory, why do I need to explicitly say it, if I'm not overriding it? Anyway, thanks for your time. I'll close the issue. |
There is a use case where people use Cucumber both for unit tests and integration tests. The unit tests are ran without any dependency injection and the integration tests with a spring application context. Because the application context be slow to start, it may be undesirable to use for unit tests. Hence the usecase to select the default object factory even when other object factories are available. This is unrelated to your problem though. Your problem was caused by merging two different jar files into a single jar file. If any file names overlap, only the contents from one of the two jars will be used. As a result Cucumber could only see one of the two object factories. This happened to be the default object factory rather then pico container. |
what is the solution for this problem ? It's not really clear what to do exactly. If there is a breaking change and extra configuration is needed, plz mention this also in the documentation. Now I'm having the same problem. I upgraded Cucumber to the latest version 7.5.x and I have the cucumber-picocontainer as a dependency in my pom.xml and I'm getting the same error. |
Describe the bug
After upgrading from 7.0.0 to any version from 7.1.0 to 7.2.3, the following error occurs when trying to run Cucumber through io.cucumber.core.cli.Main. It's basically the same problem mentioned in #2431 , but now with a reproducible example.
To Reproduce
Steps to reproduce the behavior:
docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3-adoptopenjdk-15 mvn clean package
)docker run -v "$PWD":/home -w /home openjdk:15-jdk java -jar target/demo-0.0.1-SNAPSHOT-fat-testjar.jar
)Expected behavior
The expected behavior is to run the tests with no error, as it happens when you change cucumber version to 7.0.0 in the reproducible example.
Context & Motivation
While upgrading libraries to the latest to stay up-to-date, faced this issue and stopped this upgrade.
Environment
On the reproducible example:
Cucumber version: 7.2.2
Java 15
Maven 3.6.1
Used modules: cucumber-java, cucumber-core, cucumber-junit, cucumber-picocontainer
Additional context
On the reproducible example it's generated a jar through the assembly plugin that should run the cucumber command.
Let me know if you need any more information.
The text was updated successfully, but these errors were encountered: