spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Correct comment in test examples

Open darth-raijin opened this issue 6 months ago • 2 comments
trafficstars

Changes:

  • A comment line was unecessarily split, this PR seeks to improve the readability and clean that line comment up

darth-raijin avatar May 01 '25 10:05 darth-raijin

This formatting is done by the spring-javaformat plugin, you can try it with: ./mvnw spring-javaformat:apply.

But we can make that comment more readable with something like:

// the manager sent 2 chunks ({1, 2, 3} and {4, 5, 6}) to workers
assertEquals("Waited for 2 results.", jobExecution.getExitStatus().getExitDescription());

If you update the PR accordingly, it should be good to merge.

fmbenhassine avatar Jun 03 '25 23:06 fmbenhassine

Alright, thank you for explaining how the formatting was done!

After the suggested change, we have landed on this:

// then
// the manager sent 2 chunks ({1, 2, 3} and {4, 5, 6}) to workers
assertEquals(ExitStatus.COMPLETED.getExitCode(), jobExecution.getExitStatus().getExitCode());

However it could also look like below, which should be more readable as well, and plays well into the given, when and then

// then the manager sent 2 chunks ({1, 2, 3} and {4, 5, 6}) to workers
assertEquals(ExitStatus.COMPLETED.getExitCode(), jobExecution.getExitStatus().getExitCode());

darth-raijin avatar Jun 04 '25 08:06 darth-raijin