diff --git a/spring-batch-docs/modules/ROOT/pages/testing.adoc b/spring-batch-docs/modules/ROOT/pages/testing.adoc index 2c63b27d61..ea9052f0d1 100644 --- a/spring-batch-docs/modules/ROOT/pages/testing.adoc +++ b/spring-batch-docs/modules/ROOT/pages/testing.adoc @@ -24,6 +24,8 @@ NOTE: If the test context contains a single `Job` bean definition, this bean will be autowired in `JobOperatorTestUtils`. Otherwise, the job under test should be manually set on the `JobOperatorTestUtils`. +NOTE: Spring Batch no longer supports JUnit 4. Migrate to JUnit Jupiter recommended. + [tabs] ==== diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java b/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java index d51ad56079..c3e5cb0c63 100644 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/JobScopeTestExecutionListener.java @@ -36,7 +36,7 @@ *
  * @ContextConfiguration
  * @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, JobScopeTestExecutionListener.class })
- * @RunWith(SpringJUnit4ClassRunner.class)
+ * @SpringJUnitConfig
  * public class JobScopeTestExecutionListenerIntegrationTests {
  *
  * 	// A job-scoped dependency configured in the ApplicationContext
@@ -62,6 +62,7 @@
  * @author Dave Syer
  * @author Jimmy Praet
  * @author Mahmoud Ben Hassine
+ * @author Hyuntae Park
  */
 public class JobScopeTestExecutionListener implements TestExecutionListener {
 
diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java b/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java
index 8d6a6eea44..0e8ad27ed5 100644
--- a/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java
+++ b/spring-batch-test/src/main/java/org/springframework/batch/test/StepScopeTestExecutionListener.java
@@ -37,7 +37,7 @@
  * 
  * @ContextConfiguration
  * @TestExecutionListeners( { DependencyInjectionTestExecutionListener.class, StepScopeTestExecutionListener.class })
- * @RunWith(SpringJUnit4ClassRunner.class)
+ * @SpringJUnitConfig
  * public class StepScopeTestExecutionListenerIntegrationTests {
  *
  * 	// A step-scoped dependency configured in the ApplicationContext
@@ -63,6 +63,7 @@
  * @author Dave Syer
  * @author Chris Schaefer
  * @author Mahmoud Ben Hassine
+ * @author Hyuntae Park
  */
 public class StepScopeTestExecutionListener implements TestExecutionListener {
 
diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java b/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java
index d12cbf9fc9..ac5212f87b 100644
--- a/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java
+++ b/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java
@@ -127,9 +127,11 @@
  * In the previous example, the imported configuration class
  * MyBatchJobConfiguration is expected to have such beans defined in it (or
  * imported from another configuration class). 
+ * JUnit4 is deprecated in Spring Batch 6.0.0 and will be removed in a future release.
  *
  * @author Mahmoud Ben Hassine
  * @author Taeik Lim
+ * @author Hyuntae Park
  * @since 4.1
  * @see JobOperatorTestUtils
  * @see JobRepositoryTestUtils