@Test
public void shouldReturnAllJobsDistinct() throws IOException {

    // given
    JobInfo firstJob = newJobInfo("42", "jobType1", fixed(ofEpochMilli(0), systemDefault()), "localhost");
    JobInfo secondJob = newJobInfo("42", "jobType2", fixed(ofEpochMilli(1), systemDefault()), "localhost");
    JobInfo thirdJob = newJobInfo("42", "jobType3", fixed(ofEpochMilli(2), systemDefault()), "localhost");
    when(jobService.findJobsDistinct()).thenReturn(asList(firstJob, secondJob, thirdJob));
    // when
    Object job = jobsController.getJobsAsJson(null, 100, true, false, mock(HttpServletRequest.class));
    // then
    assertThat(job, is(asList(representationOf(firstJob, null, false, "", ""),
            representationOf(secondJob, null, false, "", ""),
            representationOf(thirdJob, null, false, "", ""))));
    verify(jobService, times(1)).findJobsDistinct();
    verifyNoMoreInteractions(jobService);
}