@SuppressWarnings("deprecation") @Test void testCallException() throws Exception { JobExecutionContext jobExecutionContext = JobExecutionContext.builder().setAuthentication(authentication).setLocale(locale).build(); String message = "MyMessage"; Exception exception = new Exception(message); doThrow(exception).when(job).call(progress); assertThrows( JobExecutionException.class, () -> new JobExecutionTemplate().call(job, progress, jobExecutionContext)); verify(progress).start(); verify(progress).failed(message, exception); }
<T> T call(Job<T> job, Progress progress, JobExecutionContext jobExecutionContext) { return runWithContext(jobExecutionContext, () -> tryCall(job, progress)); }
JobExecutionTemplate { <T> T call(Job<T> job, Progress progress, JobExecutionContext jobExecutionContext) { return runWithContext(jobExecutionContext, () -> tryCall(job, progress)); } }
JobExecutionTemplate { <T> T call(Job<T> job, Progress progress, JobExecutionContext jobExecutionContext) { return runWithContext(jobExecutionContext, () -> tryCall(job, progress)); }  }
JobExecutionTemplate { <T> T call(Job<T> job, Progress progress, JobExecutionContext jobExecutionContext) { return runWithContext(jobExecutionContext, () -> tryCall(job, progress)); }   }
JobExecutionTemplate { <T> T call(Job<T> job, Progress progress, JobExecutionContext jobExecutionContext) { return runWithContext(jobExecutionContext, () -> tryCall(job, progress)); }    }