@Test
public void shouldHaveName() {

    // given
    final List<JobInfo> jobInfos = singletonList(someStoppedJob(OK, 1));
    when(jobRepository.findLatestBy(anyString(), eq(1+1))).thenReturn(jobInfos);
    // when
    final StatusDetail statusDetail = errorOnLastJobFailed.statusDetail(jobDefinition);
    // then
    assertThat(statusDetail.getName(), is("test"));
}