Skip to content

Commit b46278b

Browse files
committed
Removed BatchConfigurer and @EnableBatchProcessing from tests and samples
TaskJobLauncherApplicationRunnerTests updated Signed-off-by: Glenn Renfro <[email protected]> Updated Integration tests Updated Tests for samples
1 parent 25cf280 commit b46278b

File tree

21 files changed

+271
-357
lines changed

21 files changed

+271
-357
lines changed

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/SingleStepJobAutoConfigurationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.batch.core.Job;
2727
import org.springframework.batch.core.JobExecution;
2828
import org.springframework.batch.core.JobParameters;
29-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3029
import org.springframework.batch.core.explore.JobExplorer;
3130
import org.springframework.batch.core.launch.JobLauncher;
3231
import org.springframework.batch.item.support.ListItemReader;
@@ -154,7 +153,6 @@ private void validateConfiguration(ApplicationContextRunner applicationContextRu
154153
});
155154
}
156155

157-
@EnableBatchProcessing
158156
@Configuration
159157
public static class SimpleConfiguration {
160158

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemReaderAutoConfigurationTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.batch.core.Job;
2727
import org.springframework.batch.core.JobExecution;
2828
import org.springframework.batch.core.JobParameters;
29-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3029
import org.springframework.batch.core.explore.JobExplorer;
3130
import org.springframework.batch.core.launch.JobLauncher;
3231
import org.springframework.batch.item.file.LineCallbackHandler;
@@ -304,7 +303,6 @@ public void testCustomMapping() {
304303
});
305304
}
306305

307-
@EnableBatchProcessing
308306
@Configuration
309307
public static class CustomMappingConfiguration {
310308

@@ -331,7 +329,6 @@ public FieldSetMapper<Map<String, Object>> fieldSetMapper() {
331329

332330
}
333331

334-
@EnableBatchProcessing
335332
@Configuration
336333
public static class JobConfiguration {
337334

@@ -347,7 +344,6 @@ public ListItemWriter<Map<String, Object>> itemWriter() {
347344

348345
}
349346

350-
@EnableBatchProcessing
351347
@Configuration
352348
public static class RecordSeparatorAndSkippedLinesJobConfiguration {
353349

@@ -397,7 +393,6 @@ public ListItemWriter<Map<String, Object>> itemWriter() {
397393

398394
}
399395

400-
@EnableBatchProcessing
401396
@Configuration
402397
public static class CustomLineMapperConfiguration {
403398

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemWriterAutoConfigurationTests.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.batch.core.Job;
3131
import org.springframework.batch.core.JobExecution;
3232
import org.springframework.batch.core.JobParameters;
33-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3433
import org.springframework.batch.core.explore.JobExplorer;
3534
import org.springframework.batch.core.launch.JobLauncher;
3635
import org.springframework.batch.item.file.FlatFileFooterCallback;
@@ -361,7 +360,6 @@ public void testHeaderFooterFileGeneration() {
361360
}
362361

363362
@Configuration
364-
@EnableBatchProcessing
365363
public static class DelimitedJobConfiguration {
366364

367365
@Bean
@@ -384,7 +382,6 @@ public ListItemReader<Map<String, Object>> itemReader() {
384382
}
385383

386384
@Configuration
387-
@EnableBatchProcessing
388385
public static class LineAggregatorConfiguration {
389386

390387
@Bean
@@ -412,7 +409,6 @@ public LineAggregator<Map<String, Object>> lineAggregator() {
412409
}
413410

414411
@Configuration
415-
@EnableBatchProcessing
416412
public static class HeaderFooterConfiguration {
417413

418414
@Bean
@@ -445,7 +441,6 @@ public FlatFileFooterCallback footerCallback() {
445441
}
446442

447443
@Configuration
448-
@EnableBatchProcessing
449444
public static class FieldExtractorConfiguration {
450445

451446
@Bean
@@ -478,7 +473,6 @@ public FieldExtractor<Map<String, Object>> lineAggregator() {
478473
}
479474

480475
@Configuration
481-
@EnableBatchProcessing
482476
public static class FormattedJobConfiguration {
483477

484478
@Bean
@@ -501,7 +495,6 @@ public ListItemReader<Map<String, Object>> itemReader() {
501495
}
502496

503497
@Configuration
504-
@EnableBatchProcessing
505498
public static class FormattedFieldExtractorJobConfiguration {
506499

507500
@Bean

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/jdbc/JdbcBatchItemWriterAutoConfigurationTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.springframework.batch.core.Job;
3434
import org.springframework.batch.core.JobExecution;
3535
import org.springframework.batch.core.JobParameters;
36-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3736
import org.springframework.batch.core.explore.JobExplorer;
3837
import org.springframework.batch.core.launch.JobLauncher;
3938
import org.springframework.batch.item.database.ItemPreparedStatementSetter;
@@ -262,7 +261,6 @@ public DataSource dataSource(Server server) {
262261
}
263262

264263
@Configuration
265-
@EnableBatchProcessing
266264
public static class DelimitedJobConfiguration {
267265

268266
@Bean
@@ -285,7 +283,6 @@ public ListItemReader<Map<String, Object>> itemReader() {
285283
}
286284

287285
@Configuration
288-
@EnableBatchProcessing
289286
public static class DelimitedDifferentKeyNameJobConfiguration {
290287

291288
@Bean
@@ -308,7 +305,6 @@ public ListItemReader<Map<String, Object>> itemReader() {
308305
}
309306

310307
@Configuration
311-
@EnableBatchProcessing
312308
public static class CustomSqlParameterSourceProviderConfiguration {
313309

314310
@Bean
@@ -323,7 +319,6 @@ public ItemSqlParameterSourceProvider<Map<String, Object>> itemSqlParameterSourc
323319
}
324320

325321
@Configuration
326-
@EnableBatchProcessing
327322
public static class ItemPreparedStatementSetterConfiguration {
328323

329324
@Bean

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/jdbc/JdbcCursorItemReaderAutoConfigurationTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.batch.core.Job;
3131
import org.springframework.batch.core.JobExecution;
3232
import org.springframework.batch.core.JobParameters;
33-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3433
import org.springframework.batch.core.explore.JobExplorer;
3534
import org.springframework.batch.core.launch.JobLauncher;
3635
import org.springframework.batch.item.database.JdbcCursorItemReader;
@@ -353,7 +352,6 @@ public DataSource dataSource(Server server) {
353352

354353
}
355354

356-
@EnableBatchProcessing
357355
@Configuration
358356
public static class BaseConfiguration {
359357

@@ -364,7 +362,6 @@ public ListItemWriter<Map<String, Object>> itemWriter() {
364362

365363
}
366364

367-
@EnableBatchProcessing
368365
@Configuration
369366
public static class RowMapperConfiguration {
370367

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/kafka/KafkaItemReaderAutoConfigurationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.springframework.batch.core.Job;
3333
import org.springframework.batch.core.JobExecution;
3434
import org.springframework.batch.core.JobParameters;
35-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3635
import org.springframework.batch.core.explore.JobExplorer;
3736
import org.springframework.batch.core.launch.JobLauncher;
3837
import org.springframework.batch.item.support.ListItemWriter;
@@ -214,7 +213,6 @@ private void populateSingleTopic(String topic) {
214213
producer.close();
215214
}
216215

217-
@EnableBatchProcessing
218216
@Configuration
219217
public static class CustomMappingConfiguration {
220218

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/kafka/KafkaItemWriterTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.batch.core.Job;
3131
import org.springframework.batch.core.JobExecution;
3232
import org.springframework.batch.core.JobParameters;
33-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3433
import org.springframework.batch.core.explore.JobExplorer;
3534
import org.springframework.batch.core.launch.JobLauncher;
3635
import org.springframework.batch.item.support.ListItemReader;
@@ -118,7 +117,6 @@ private void waitForTopicPopulation(ApplicationContext context) throws Exception
118117
}
119118
}
120119

121-
@EnableBatchProcessing
122120
@Configuration
123121
public static class CustomMappingConfiguration {
124122

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/rabbit/AmqpItemReaderAutoConfigurationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.springframework.batch.core.Job;
4040
import org.springframework.batch.core.JobExecution;
4141
import org.springframework.batch.core.JobParameters;
42-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
4342
import org.springframework.batch.core.explore.JobExplorer;
4443
import org.springframework.batch.core.launch.JobLauncher;
4544
import org.springframework.batch.item.support.ListItemWriter;
@@ -203,7 +202,6 @@ Class<?> itemTypeClass() {
203202

204203
}
205204

206-
@EnableBatchProcessing
207205
@Configuration
208206
public static class BaseConfiguration {
209207

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/rabbit/AmqpItemWriterAutoConfigurationTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.springframework.batch.core.Job;
4343
import org.springframework.batch.core.JobExecution;
4444
import org.springframework.batch.core.JobParameters;
45-
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
4645
import org.springframework.batch.core.explore.JobExplorer;
4746
import org.springframework.batch.core.launch.JobLauncher;
4847
import org.springframework.batch.item.ItemReader;
@@ -173,13 +172,11 @@ private JobExecution runJob(AssertableApplicationContext context) throws Excepti
173172
return jobLauncher.run(job, new JobParameters());
174173
}
175174

176-
@EnableBatchProcessing
177175
@Configuration
178176
public static class BaseConfiguration extends ItemWriterConfiguration {
179177

180178
}
181179

182-
@EnableBatchProcessing
183180
@Configuration
184181
public static class MockConfiguration extends ItemWriterConfiguration {
185182

0 commit comments

Comments
 (0)