-
-
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] CucumberBackendException: No qualifying bean of type #2515
Comments
Interesting. Cucumber isn't behaving but the setup you've created is odd too. Unlike JUnit, all step definition classes are part of the test context. So there is no need to make the Is there a reason you are extending this class? |
Note that Cucumber is failing after the test because java8 step definitions are registered dynamically. This could be made more robust by keeping a reference to the instance of the annotated class in the TestContextAdaptor rather then fetching it again.
|
Yes, I need this abstract class as it's where I'm doing the test setup like initiating the test db container and mock servers for external services, ... etc and sorry I don't get your point regarding your second comment, can you please give me more explanation on what to do? |
After using v 6.11.0 which contains only one call start for CucumberTestContext as mentioned here #2516 every thing seems to be working fine So I will be waiting for the fix in 7.x.x version |
Ah cool! Could you try building 2d67224 and trying the snapshot version? |
Release might not happen soon yet. Something in GH actions changed and I don't know what yet. |
Same problem with the new SNAPSHOT version. |
Ah okay. Then I think it is mostly #2491. The That said, I reckon this would also break your setup once you have more then one step definition class that extends the
Could you show this in a bit more detail. I don't believe either Spring or Cucumber has any meaningful hooks for this that can't be replicated without the use of abstract classes. |
Yes, I've done some workaround to Define the CucumberBootstrap class which contains the context configuration annotations @CucumberContextConfiguration and @SpringBootTest ,and separated my common code in a different parent abstract class for all the Stepdefs But actually this worked only with Java not with Java8, I don't know what's is the reason. |
I wouldn't be able to say that with certainty. You'd have to sprinkle some break points around in the |
I'm going to say that using: @CucumberContextConfiguration
public abstract class AbstractIntegrationTest implements En {} isn't supported, there should be a single concrete instance of an |
When trying to run step defs with abstract class contains all the context configuration spring sees 2 differnt beans parent and stepdef
I'm using spring boot version: 2.6.4 , with Junit 5 and cucumber version 7.2.3
Exception Stack trace:
The text was updated successfully, but these errors were encountered: