Spring Batch Testing and Best Practices Flashcards
(5 cards)
1
Q
How do you test an ItemProcessor?
A
By using JUnit with mock inputs and verifying outputs.
2
Q
How can you test a complete batch job?
A
By using JobLauncherTestUtils.
3
Q
How do you mock an ItemReader in tests?
A
By using Mockito to return predefined values.
4
Q
What is the best way to handle large datasets in Spring Batch?
A
Using chunk processing with paging and parallel steps.
5
Q
How can you optimize batch processing performance?
A
By tuning chunk size, using parallel steps, and optimizing database queries.