### Question:
BackgroundJob implements Callable<T> { public void logPartialSuccess(final AutoPromoteFailedException e) { logWithTiming("Partial Success:", "Failed"); logCauses(e); }  void log(final String message); void logComplete(); void logWithTiming(final String message, final String timingKey); String getLog(); JobStatus getStatus(); void setStatus(final JobStatus status); Future<T> getFuture(); void setFuture(final Future<T> future); void setId(final long id); Long getId(); void setUUID(final UUID uuid); UUID getUUID(); List<ResultUrl> getUrls(); void addUrl(final String url, final String text); void addUrl(final String url, final String text, final String target); void addUrl(final ResultUrl url); String getEndMessage(); void setEndMessage(final String endMessage); @CheckForNull String getErrorMessage(); Throwable getError(); void setError(final Throwable error); long getCreatedTime(); Map<String, Long> getTimings(); String toString(); boolean isRunning(); abstract String getTitle(); abstract String getUsername(); JobType getJobType(); void logFailedJob(final Throwable t); void logPartialSuccess(final AutoPromoteFailedException e); @Override T call(); @Nonnull JobInfo getJobInfo();  }### Answer:
@Test public void logPartialSuccess() { final String message = "auto-promote failed"; final Future future = mock(Future.class); when(future.isCancelled()).thenReturn(false); job.setFuture(future); job.logPartialSuccess(new AutoPromoteFailedException(message)); assertThat(job.getLog()).isEqualTo("Partial Success:\n" + message + "\n"); assertThat(job.getError()).isInstanceOf(AutoPromoteFailedException.class); assertThat(job.getStatus()).isEqualTo(BackgroundJob.JobStatus.PARTIAL_SUCCESS); }