Skip to content

[Spring] Deprecate cucumber.xml and implied context configuration #1940

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

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

mpkorstanje
Copy link
Contributor

The prefered way to use cucumber-spring is to annotate a class
with both @CucumberContextConfiguration and a Spring context
configuration annotation such as @ContextConfiguration,
@SpringBootTest, ect.

Cucumber currently supports the discovery of context
configuration on any step defintion class. This requires a
significant amount of code and intimate knowledge of the
Spring Framework.
By restricting this too only classes annotated with
@CucumberContextConfiguration we can remove this complexity and
simply pass the annotated class to Spring TestContextManager
framework.

If no context configuration is available Cucumber currently also
support reading the application context from a magical
cucumber.xml file or should none exist an empty application
context.
Both these fallback strategies tend to hide user errors. And
removing them will provide more clarity and also remove
a nuggest of complexity.

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.

The prefered way to use `cucumber-spring` is to annotate a class
with both `@CucumberContextConfiguration` and a Spring context
configuration annotation such as `@ContextConfiguration`,
`@SpringBootTest`, ect.

Cucumber currently supports the discovery of context
configuration on any step defintion class. This requires a
significant amount of code and intimate knowledge of the
Spring Framework.
By restricting this too only classes annotated with
`@CucumberContextConfiguration` we can remove this complexity and
simply pass the annotated class to Spring `TestContextManager`
framework.

If no context configuration is available Cucumber currently also
support reading the application context from a magical
`cucumber.xml` file or should none exist an empty application
context.
Both these fallback strategies tend to hide user errors. And
removing them will provide more clarity and also remove
a nuggest of complexity.

Closes: #1904
@mpkorstanje mpkorstanje added this to the 5.x.x milestone Apr 9, 2020
@mpkorstanje mpkorstanje requested a review from mlvandijk April 9, 2020 20:16
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 86.105% when pulling e12c7fc on spring-deprecate-and-update into e544745 on master.

@mpkorstanje mpkorstanje marked this pull request as ready for review April 9, 2020 20:32
@mpkorstanje mpkorstanje merged commit 98a38a0 into master Apr 11, 2020
@mpkorstanje mpkorstanje deleted the spring-deprecate-and-update branch April 11, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants