@Override
    protected void runTask() {
        LOGGER.trace("Looking for succeeded jobs that can go to the deleted state... ");
        final Instant updatedBefore = now().minus(backgroundJobServerConfiguration().getDeleteSucceededJobsAfter());
        processManyJobs(previousResults -> getSucceededJobs(updatedBefore, previousResults),
                job -> job.delete("JobRunr maintenance - deleting succeeded job"),
                this::handleTotalAmountOfSucceededJobs);
    }
@Test
    @Because("https://github.com/jobrunr/jobrunr/issues/27")
    void taskMovesSucceededJobsToDeletedStateAlsoForMethodsThatDontExistAnymore() {
        Job job = aSucceededJob().withJobDetails(methodThatDoesNotExistJobDetails()).build();

        lenient().when(storageProvider.getJobList(eq(SUCCEEDED), any(Instant.class), any()))
                .thenReturn(
                        singletonList(job),
                        emptyJobList());

        // WHEN
        runTask(task);

        // THEN
        assertThat(logger).hasNoWarnLogMessages();
        verify(storageProvider).save(anyList());
        verify(storageProvider).publishTotalAmountOfSucceededJobs(1);
    }