@Test
@SuppressWarnings("unchecked")
public void shouldReturnAllJobsOfTypeAsHtml() {

    JobInfo firstJob = newJobInfo("42", "SOME_TYPE", systemDefaultZone(), "localhost");
    when(jobService.findJobs(Optional.of("SOME_TYPE"), 100)).thenReturn(asList(firstJob));
    ModelAndView modelAndView = jobsController.getJobsAsHtml("SOME_TYPE", 100, false, mock(HttpServletRequest.class));
    List<JobRepresentation> jobs = (List<JobRepresentation>) modelAndView.getModel().get("jobs");
    assertThat(jobs, is(asList(representationOf(firstJob, null, false, "", ""))));
}