LogJobErrorHandler implements JobErrorHandler { @Override public void handleException(final String jobName, final Throwable cause) { log.error(String.format("Job '%s' exception occur in job processing", jobName), cause); }  @Override void handleException(final String jobName, final Throwable cause); @Override String getType();  }
@Test public void assertHandleException() { LogJobErrorHandler actual = (LogJobErrorHandler) JobErrorHandlerFactory.createHandler("LOG").orElseThrow(() -> new JobConfigurationException("LOG error handler not found.")); setStaticFieldValue(actual); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); verify(log).error("Job 'test_job' exception occur in job processing", cause); }