@Test
public void executeJobLogsFailureWhenJobThrowsException() throws Exception {

    // given
    var jobId = "JOB";
    var currentTime = LocalDateTime.now(clock);
    var expectedJobLog = new ScheduledJobLog(currentTime, jobId, ScheduledJobLog.Status.FAILURE);
    willThrow(new Exception()).given(jobMock).execute();
    Callable<Void> callable = () -> {
        jobMock.execute();
        return null;
    };
    // when
    scheduledJobExecutor.execute(callable, jobId);
    // then
    verify(jobLogRepoMock).save(jobLogArgumentCaptor.capture());
    var actualJobLog = jobLogArgumentCaptor.getValue();
    assertThat(actualJobLog).isEqualTo(expectedJobLog);
}