@Test public void testExportListenerException() { final AtomicInteger failureBatchCount = new AtomicInteger(); testListenerException( new ExportListener() .withTransform(new ServerTransform("thisTransformDoesntExist")) .onBatchFailure( (batch, throwable) -> failureBatchCount.incrementAndGet() ) ); // there should be one failure sent to the ExportListener // onBatchFailure listener since the transform is invalid assertEquals(1, failureBatchCount.get()); }