@Test void testCanceling() { JobExecution mockJobExecution = mock(JobExecution.class); ProgressImpl progressImpl = new ProgressImpl(mockJobExecution, updater, mailSender); progressImpl.canceling(); verify(mockJobExecution).setStatus(Status.CANCELING); verify(updater).update(mockJobExecution); }
@Override public void canceling() { synchronized (this) { JobExecution currentJobExecution = JobExecutionHolder.get(); if (currentJobExecution == null) { JobExecutionHolder.set(this.jobExecution); } JOB_EXECUTION_LOG.warn("Canceling ..."); if (currentJobExecution == null) { JobExecutionHolder.unset(); } } jobExecution.setStatus(Status.CANCELING); update(); }
ProgressImpl implements Progress { @Override public void canceling() { synchronized (this) { JobExecution currentJobExecution = JobExecutionHolder.get(); if (currentJobExecution == null) { JobExecutionHolder.set(this.jobExecution); } JOB_EXECUTION_LOG.warn("Canceling ..."); if (currentJobExecution == null) { JobExecutionHolder.unset(); } } jobExecution.setStatus(Status.CANCELING); update(); } }
ProgressImpl implements Progress { @Override public void canceling() { synchronized (this) { JobExecution currentJobExecution = JobExecutionHolder.get(); if (currentJobExecution == null) { JobExecutionHolder.set(this.jobExecution); } JOB_EXECUTION_LOG.warn("Canceling ..."); if (currentJobExecution == null) { JobExecutionHolder.unset(); } } jobExecution.setStatus(Status.CANCELING); update(); } ProgressImpl(JobExecution jobExecution, JobExecutionUpdater updater, MailSender mailSender); }
ProgressImpl implements Progress { @Override public void canceling() { synchronized (this) { JobExecution currentJobExecution = JobExecutionHolder.get(); if (currentJobExecution == null) { JobExecutionHolder.set(this.jobExecution); } JOB_EXECUTION_LOG.warn("Canceling ..."); if (currentJobExecution == null) { JobExecutionHolder.unset(); } } jobExecution.setStatus(Status.CANCELING); update(); } ProgressImpl(JobExecution jobExecution, JobExecutionUpdater updater, MailSender mailSender); @Override void start(); @Override void progress(int progress, String message); @Override void increment(int amount); @Override void success(); @SuppressWarnings( "java:S2629") // "Preconditions" and logging arguments should not require evaluation @Override void failed(String message, @Nullable @CheckForNull Throwable throwable); @Override void canceling(); @Override void canceled(); @Override Long timeRunning(); @Override void setProgressMax(int max); @Override void status(String message); @Override void setResultUrl(String string); @Override JobExecution getJobExecution(); }
ProgressImpl implements Progress { @Override public void canceling() { synchronized (this) { JobExecution currentJobExecution = JobExecutionHolder.get(); if (currentJobExecution == null) { JobExecutionHolder.set(this.jobExecution); } JOB_EXECUTION_LOG.warn("Canceling ..."); if (currentJobExecution == null) { JobExecutionHolder.unset(); } } jobExecution.setStatus(Status.CANCELING); update(); } ProgressImpl(JobExecution jobExecution, JobExecutionUpdater updater, MailSender mailSender); @Override void start(); @Override void progress(int progress, String message); @Override void increment(int amount); @Override void success(); @SuppressWarnings( "java:S2629") // "Preconditions" and logging arguments should not require evaluation @Override void failed(String message, @Nullable @CheckForNull Throwable throwable); @Override void canceling(); @Override void canceled(); @Override Long timeRunning(); @Override void setProgressMax(int max); @Override void status(String message); @Override void setResultUrl(String string); @Override JobExecution getJobExecution();  }