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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you test a complete batch job?

A

By using JobLauncherTestUtils.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you mock an ItemReader in tests?

A

By using Mockito to return predefined values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the best way to handle large datasets in Spring Batch?

A

Using chunk processing with paging and parallel steps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you optimize batch processing performance?

A

By tuning chunk size, using parallel steps, and optimizing database queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly