@Test public void taskReturnsFailureIfServerReturnsFalse() { when(server.markReviewAsRead(review)).thenReturn(false); assertEquals(BackgroundTask.RETURN_FAILURE, task.start(progress)); }
@Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); boolean success = server.markReviewAsRead(review); progress.incrementProgress(1); return success ? RETURN_SUCCESS : RETURN_FAILURE; }
MarkReviewAsReadTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); boolean success = server.markReviewAsRead(review); progress.incrementProgress(1); return success ? RETURN_SUCCESS : RETURN_FAILURE; } }
MarkReviewAsReadTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); boolean success = server.markReviewAsRead(review); progress.incrementProgress(1); return success ? RETURN_SUCCESS : RETURN_FAILURE; } MarkReviewAsReadTask(ServerManager server, Review review); }
MarkReviewAsReadTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); boolean success = server.markReviewAsRead(review); progress.incrementProgress(1); return success ? RETURN_SUCCESS : RETURN_FAILURE; } MarkReviewAsReadTask(ServerManager server, Review review); @Override int start(TaskStatusMonitor progress); }
MarkReviewAsReadTask extends BackgroundTask { @Override public int start(TaskStatusMonitor progress) { progress.startProgress(this.getDescription(), 1); boolean success = server.markReviewAsRead(review); progress.incrementProgress(1); return success ? RETURN_SUCCESS : RETURN_FAILURE; } MarkReviewAsReadTask(ServerManager server, Review review); @Override int start(TaskStatusMonitor progress);  }