-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
@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, |
There was a problem hiding this 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.
spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java
Outdated
Show resolved
Hide resolved
spring-batch-test/src/test/java/org/springframework/batch/test/SpringBatchTestJUnit4Tests.java
Outdated
Show resolved
Hide resolved
spring-batch-test/src/test/java/org/springframework/batch/test/SpringBatchTestJUnit5Tests.java
Outdated
Show resolved
Hide resolved
Thank you for your feedback! I pushed an update that addresses your suggestions. Let me know if anything else should be updated.
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> |
You're welcome.
LGTM 👍 |
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 withSpringExtension
.Issue #3647