Skip to content

Meta-annotate @SpringBatchTest with @ExtendWith(SpringExtension.class) #3697

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 2 commits into from
Apr 30, 2020

Conversation

fmbenhassine
Copy link
Contributor

@fmbenhassine fmbenhassine commented Apr 18, 2020

This PR meta-annotates @SpringBatchTest with @ExtendWith(SpringExtension.class) so it can be used in a JUnit Jupiter test without having to extend the test class with SpringExtension.

Issue #3647

@fmbenhassine fmbenhassine marked this pull request as ready for review April 30, 2020 10:49
@fmbenhassine fmbenhassine requested a review from sbrannen April 30, 2020 10:52
@fmbenhassine
Copy link
Contributor Author

@sbrannen Hi Sam,

Could you please take a look at this PR? Let me know if it needs any updates.

Many thanks upfront!

Best regards,
Mahmoud

Copy link
Member

@sbrannen sbrannen 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 the changes look good.

I only made a small suggestion regarding the JavaDoc and pointed out a convenience feature of the Spring TestContext Framework.

As a sanity check, you might want to manually verify that JUnit Jupiter artifacts don't end up as mandatory dependencies in the generated POM.

@fmbenhassine
Copy link
Contributor Author

Thank you for your feedback! I pushed an update that addresses your suggestions. Let me know if anything else should be updated.

As a sanity check, you might want to manually verify that JUnit Jupiter artifacts don't end up as mandatory dependencies in the generated POM.

I did a quick check, and the dependency is optional as expected, here is an extract from the generated pom:

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.6.2</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

@sbrannen
Copy link
Member

Thank you for your feedback!

You're welcome.

Let me know if anything else should be updated.

LGTM 👍

@fmbenhassine fmbenhassine merged commit fe51fde into spring-projects:master Apr 30, 2020
@fmbenhassine fmbenhassine deleted the GH-3647 branch April 30, 2020 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta-annotate @SpringBatchTest with @ExtendWith(SpringExtension.class)
2 participants