You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Up to 7.0.0 my StepsDefinitions class is working fine with spring injection. But after updating to 7.1.0 I've started getting the following error:
io.cucumber.core.exception.CucumberException: class *ClassWithSteps* does not have a public zero-argument constructor.
To use dependency injection add an other ObjectFactory implementation such as:
* cucumber-picocontainer
* cucumber-spring
* cucumber-jakarta-cdi
* ...ect
at io.cucumber.core.backend.DefaultObjectFactory.cacheNewInstance(DefaultObjectFactory.java:57)
...
To Reproduce
Steps definitions class looks like the following one:
@RequiredArgsConstructor
@CucumberContextConfiguration
@ContextConfiguration(classes = TestConfig.class)
public class ClassWithSteps {
private final SomeService1 injectedService1;
private final SomeService2 injectedService2;
// ... all @Given, @When, @Then methods
}
Tests get running through the TestRunner class annotated with @RunWith(Cucumber.class) and @CucumberOptions.
Context & Motivation
I see recently merged PR #2400. And want to know if I have a bad config now regarding this newly added DefaultObjectFactory? Or is there an issue with DefaultObjectFactory itself?
Environment
Cucumber version: 7.1.0
Java 11
Maven 3.6.1
Used modules: cucumber-java, cucumber-junit, cucumber-spring
Are you running from an executable jar? If so you may be clobbering the service description when unpacking and merging jar files.
Either way can you debug the ObjectFactoryServiceLoader to describe the problem in sufficient detail or provide a minimal reproducer in the form of a GitHub repo?
Describe the bug
Up to 7.0.0 my StepsDefinitions class is working fine with spring injection. But after updating to 7.1.0 I've started getting the following error:
To Reproduce
TestRunner
class annotated with@RunWith(Cucumber.class)
and@CucumberOptions
.Context & Motivation
I see recently merged PR #2400. And want to know if I have a bad config now regarding this newly added
DefaultObjectFactory
? Or is there an issue withDefaultObjectFactory
itself?Environment
@mpkorstanje
The text was updated successfully, but these errors were encountered: