### Question:
SagaEndTask implements SagaTask { @Segment(name = "endTaskCommit", category = "application", library = "kamon") @Override public SagaResponse commit(SagaRequest request, SagaResponse parentResponse) { sagaLog.offer(new SagaEndedEvent(sagaId, request)); return SagaResponse.EMPTY_RESPONSE; } SagaEndTask(String sagaId, SagaLog sagaLog); @Segment(name = "endTaskCommit", category = "application", library = "kamon") @Override SagaResponse commit(SagaRequest request, SagaResponse parentResponse); @Override void compensate(SagaRequest request); @Override void abort(SagaRequest request, Exception e);  }### Answer:
@Test public void emptyResponseOnSuccessfulEventPersistence() throws Exception { ArgumentCaptor<SagaEndedEvent> argumentCaptor = ArgumentCaptor.forClass(SagaEndedEvent.class); doNothing().when(sagaLog).offer(argumentCaptor.capture()); sagaEndTask.commit(request, SagaResponse.EMPTY_RESPONSE); SagaEndedEvent event = argumentCaptor.getValue(); assertThat(event.sagaId, is(sagaId)); assertThat(event.json(null), is("{}")); assertThat(event.payload(), is(request)); }