@Test
public void testCreateJob() throws Exception
{

    // Create a job create request.
    JobCreateRequest jobCreateRequest = new JobCreateRequest();
    jobCreateRequest.setNamespace(JOB_NAMESPACE);
    jobCreateRequest.setJobName(JOB_NAME);
    // Create a job.
    Job job = new Job();
    job.setId(JOB_ID);
    // Mock the external calls.
    when(jobService.createAndStartJob(jobCreateRequest)).thenReturn(job);
    // Call the method under test.
    Job result = jobRestController.createJob(jobCreateRequest);
    // Verify the external calls.
    verify(jobService).createAndStartJob(jobCreateRequest);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(job, result);
}