Skip to content
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

Deprecate Spring context configuration by more than one class #1259

Merged
merged 1 commit into from
Oct 15, 2017

Conversation

brasmusson
Copy link
Contributor

Summary

Deprecate Spring context configuration by more than one class

Details

Print a warning if more than one glue class that attempts to configure the Spring context is found (that is have a @ContextConfiguration or @ContextHierarcy annotation.

Motivation and Context

We have decided to only allow one glue class to configure the Spring context, as this is a non-backward compatible change, it will be introduced in v3.0.0 (#1246). Until then a deprecation warning should be printed.

How Has This Been Tested?

The automated test suite has been updated to verify this behavior.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 81.259% when pulling 0d0baef on spring-context-deprecation-warning into 9a951ec on master.

Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your editor is configured to use tabs instead of spaces.

@brasmusson brasmusson force-pushed the spring-context-deprecation-warning branch from 0d0baef to 83da61a Compare October 15, 2017 13:35
@brasmusson
Copy link
Contributor Author

Removed all tabs.

@mpkorstanje mpkorstanje merged commit 8ba2a50 into master Oct 15, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 81.259% when pulling 83da61a on spring-context-deprecation-warning into 9a951ec on master.

@brasmusson brasmusson deleted the spring-context-deprecation-warning branch October 15, 2017 18:44
@mpkorstanje
Copy link
Contributor

mpkorstanje commented Apr 2, 2018

Hi all. I'm new to Cucumber and I've seen most of the tutorials on Cucumber-Spring-Boot stack recommending that each step class should extend some base SpringBootIntegrationTest class, which configures context. How should this work now when this change is introduced? Is there any material explaining best new approach?

Your step definitions no longer have to extend from that class. You can either pick any one of your step definition classes and put the spring configuration on that one. Or you can use a dedicated class like
CucumberContextConfiguration. As long as the class has at least one step def it will be discovered.

@mpkorstanje
Copy link
Contributor

Is there any material explaining best new approach?

The example project is your best guess at the moment.

https://github.com/cucumber/cucumber-jvm/tree/master/examples/spring-txn

@tobamaestro
Copy link

Thanks. I've found it in the meantime and I removed my previous question, but I guess it's good you replied if anyone else wonders about the same thing again.

@lock
Copy link

lock bot commented Apr 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants