10 Comments

  1. Author

    Hi! Thanks for the feedback. I updated the post and the source code to cover that use case.

  2. Great article, it helped me a lot. Nevertheless, there’s an issue when having multiple StepDefinitions that extend SpringBootBaseIntegrationTest, as there are multiple definitions of a spring context. More specifically, it outputs this exception:

    cucumber.runtime.CucumberException: Glue class class com.wtvr.FeatureXSteps and class com.wtvr.FeatureYSteps both attempt to configure the spring context. Please ensure only one glue class configures the spring context

  3. Hello, thanks for the walkthrough, we have a similar setup but we now want to extend our step definition to be in separate files for single responsibility. Now when we try to run our tests, we get errors saying that “please ensure that only one glue class configures the spring context”. We believe this is because both step definition files are extending the SpringBootBaseIntegrationTest class. We’ve tried extending the SpringBootBaseIntegrationTest in the BagOfCucumbers class but it doesn’t start up Spring.

    Any ideas how to get round this issue. Thank you.

  4. Thank you for great article, How do you create jar and run from command line ?

    1. Author

      The most common option to run these tests from the command line is to simply use maven so they will run as part of the build.
      $ mvn clean test
      If you really want to run tests from within the jar file, check this link.

  5. Now how do you use @Autowired. It is null in step definitions file when trying to auto wire a Apache Camel ProducerTemplate.

  6. Thank you so much, this is the one blog post which helped me getting my cucumber test case running with ‘io.cucumber’ dependency. Many other blogs are using ‘info.cukes’ dependencies, even though its years old. Thanks much.

  7. Thanks for this great article.
    Do you have an idea of how to make the tests Transactional for Rollback database changes at the end of a scenario. typically in my springboot junit tests i use the Transactional annotation. transactionaltestexecutionlistener does the magic.
    how can i use similar behaviour Here?

    thanks

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.