@Test
public void testGetJobs() throws Exception
{

    // Create a job summary.
    JobSummary jobSummary = new JobSummary();
    jobSummary.setId(JOB_ID);
    jobSummary.setNamespace(JOB_NAMESPACE);
    jobSummary.setJobName(JOB_NAME);
    // Create a job summaries object.
    JobSummaries jobSummaries = new JobSummaries(Arrays.asList(jobSummary));
    // Mock the external calls.
    when(jobService.getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME, END_TIME)).thenReturn(jobSummaries);
    // Call the method under test.
    JobSummaries result = jobRestController.getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME.toString(), END_TIME.toString());
    // Verify the external calls.
    verify(jobService).getJobs(JOB_NAMESPACE, JOB_NAME, JobStatusEnum.RUNNING, START_TIME, END_TIME);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(jobSummaries, result);
}