@Test public void givenAStepStartedWith1000Employees_when999ItemsAreWrittenTwice_thenProgressIs99() { startAStepWithEmployees(1000); jobProgressListener.afterWrite(aListWithSize(999)); Mockito.verify(eventBus, times(2)).post(eventArgumentCaptor.capture()); JobProgressEvent jobProgressEvent = eventArgumentCaptor.getValue(); checkPercentageComplete(jobProgressEvent, 99); }
@Override public void afterWrite(List items) { currentItemCount.addAndGet(items.size()); int percentageComplete = currentItemCount.intValue() * 100 / totalItemCount; sentUpdateIfNeeded(percentageComplete); }
SingleJVMJobProgressListener implements JobProgressListener { @Override public void afterWrite(List items) { currentItemCount.addAndGet(items.size()); int percentageComplete = currentItemCount.intValue() * 100 / totalItemCount; sentUpdateIfNeeded(percentageComplete); } }
SingleJVMJobProgressListener implements JobProgressListener { @Override public void afterWrite(List items) { currentItemCount.addAndGet(items.size()); int percentageComplete = currentItemCount.intValue() * 100 / totalItemCount; sentUpdateIfNeeded(percentageComplete); }  }
SingleJVMJobProgressListener implements JobProgressListener { @Override public void afterWrite(List items) { currentItemCount.addAndGet(items.size()); int percentageComplete = currentItemCount.intValue() * 100 / totalItemCount; sentUpdateIfNeeded(percentageComplete); }  @Override @BeforeStep void beforeStep(StepExecution stepExecution); @Override void afterWrite(List items); @Override @AfterStep ExitStatus afterStep(StepExecution stepExecution); @Override void beforeWrite(List items); @Override void onWriteError(Exception exception, List items); }
SingleJVMJobProgressListener implements JobProgressListener { @Override public void afterWrite(List items) { currentItemCount.addAndGet(items.size()); int percentageComplete = currentItemCount.intValue() * 100 / totalItemCount; sentUpdateIfNeeded(percentageComplete); }  @Override @BeforeStep void beforeStep(StepExecution stepExecution); @Override void afterWrite(List items); @Override @AfterStep ExitStatus afterStep(StepExecution stepExecution); @Override void beforeWrite(List items); @Override void onWriteError(Exception exception, List items);  }