### Question:
JobService extends AbstractService { public List<Job> getJobs() { return asList(client().getForObject(SEGMENT_API_XML + "?depth=2", Job[].class)); } JobService();  JobService(JenkinsClient client); List<Job> getJobs(); Job createJob(String name, JobConfiguration configuration); Job updateJob(String name, JobConfiguration configuration); Job updateJob(Job job, JobConfiguration configuration); void deleteJob(String name); void deleteJob(Job job); Job getJob(String name); JobConfiguration getJobConfiguration(Job job); JobConfiguration getJobConfiguration(String name); Long triggerBuild(Job job); Long triggerBuild(Job job, Map<String, Object> parameters); Build getBuild(Job job, Long buildNumber); Build getBuild(String name, Long buildNumber); Build triggerBuildAndWait(Job job); Build triggerBuildAndWait(Job job, Map<String, Object> parameters);  }### Answer:
@Test public void getJobs() throws Exception { Job[] someJobs = new Job[] {}; when(client.getForObject("/api/xml?depth=2", Job[].class)).thenReturn(someJobs); assertEquals(Arrays.asList(someJobs), service.getJobs()); }