LogSkippedItemListener implements SkipListener<Object, BatchExcelRow>, ItemProcessListener<Object, Object> { @Override public void onSkipInWrite(BatchExcelRow item, Throwable t) { WRITE.info("on_skip_write", item); }  @Override void onSkipInRead(Throwable t); @Override void onSkipInWrite(BatchExcelRow item, Throwable t); @Override void onSkipInProcess(Object item, Throwable t); @Override void beforeProcess(Object item); @Override void afterProcess(Object item, Object result); @Override void onProcessError(Object item, Exception e);  }
@Test public void testOnSkipInWrite() throws Exception { listener.onSkipInWrite(new BatchExcelRow .Builder(LocalDate.now(), Sens.DEPARTURE) .departureStation(new Station("foo")) .arrivalStation(new Station("bar")) .expectedDepartureTime(LocalTime.parse("15:00")) .expectedArrivalTime(LocalTime.parse("16:00")) .build(false), null ); Assert.assertTrue(appender.getEvents() .stream() .anyMatch(logEvent -> { String formattedMessage = logEvent .getMessage() .getFormattedMessage(); return formattedMessage.contains("foo") && formattedMessage.contains("bar") && formattedMessage.contains("15:00 16:00"); })); }