@Test public void onSuccessFetchesAndShowAndMarksAsReadAllUnseenReviews() { List<Review> reviews = new ArrayList<Review>(); Review r1 = new Review(); r1.setMarkedAsRead(false); reviews.add(r1); Review r2 = new Review(); r2.setMarkedAsRead(false); reviews.add(r2); when(reviewDAO.unseen()).thenReturn(reviews); listener.onSuccess(); verify(reviewDAO, times(1)).unseen(); verify(invoker, times(2)).invokeCodeReviewDialog(any(Review.class)); verifyNoMoreInteractions(invoker); assertTrue(r1.isMarkedAsRead()); assertTrue(r2.isMarkedAsRead()); }
@Override public void onSuccess() { List<Review> unseen = reviewDAO.unseen(); if (unseen.isEmpty() && showMessages) { invoker.invokeMessageBox("No new code reviews."); return; } else if (!unseen.isEmpty() && !showMessages) { invoker.invokeCodeReviewPopupNotification(unseen); } else{ for (Review r : unseen) { r.setMarkedAsRead(true); invoker.invokeCodeReviewDialog(r); } } }
FetchCodeReviewsTaskListener implements BackgroundTaskListener { @Override public void onSuccess() { List<Review> unseen = reviewDAO.unseen(); if (unseen.isEmpty() && showMessages) { invoker.invokeMessageBox("No new code reviews."); return; } else if (!unseen.isEmpty() && !showMessages) { invoker.invokeCodeReviewPopupNotification(unseen); } else{ for (Review r : unseen) { r.setMarkedAsRead(true); invoker.invokeCodeReviewDialog(r); } } } }
FetchCodeReviewsTaskListener implements BackgroundTaskListener { @Override public void onSuccess() { List<Review> unseen = reviewDAO.unseen(); if (unseen.isEmpty() && showMessages) { invoker.invokeMessageBox("No new code reviews."); return; } else if (!unseen.isEmpty() && !showMessages) { invoker.invokeCodeReviewPopupNotification(unseen); } else{ for (Review r : unseen) { r.setMarkedAsRead(true); invoker.invokeCodeReviewDialog(r); } } } FetchCodeReviewsTaskListener(FetchCodeReviewsTask task, IdeUIInvoker invoker, ReviewDAO reviewDAO,
            boolean showMessages); }
FetchCodeReviewsTaskListener implements BackgroundTaskListener { @Override public void onSuccess() { List<Review> unseen = reviewDAO.unseen(); if (unseen.isEmpty() && showMessages) { invoker.invokeMessageBox("No new code reviews."); return; } else if (!unseen.isEmpty() && !showMessages) { invoker.invokeCodeReviewPopupNotification(unseen); } else{ for (Review r : unseen) { r.setMarkedAsRead(true); invoker.invokeCodeReviewDialog(r); } } } FetchCodeReviewsTaskListener(FetchCodeReviewsTask task, IdeUIInvoker invoker, ReviewDAO reviewDAO,
            boolean showMessages); @Override void onBegin(); @Override void onSuccess(); @Override void onFailure(); @Override void onInterruption(); }
FetchCodeReviewsTaskListener implements BackgroundTaskListener { @Override public void onSuccess() { List<Review> unseen = reviewDAO.unseen(); if (unseen.isEmpty() && showMessages) { invoker.invokeMessageBox("No new code reviews."); return; } else if (!unseen.isEmpty() && !showMessages) { invoker.invokeCodeReviewPopupNotification(unseen); } else{ for (Review r : unseen) { r.setMarkedAsRead(true); invoker.invokeCodeReviewDialog(r); } } } FetchCodeReviewsTaskListener(FetchCodeReviewsTask task, IdeUIInvoker invoker, ReviewDAO reviewDAO,
            boolean showMessages); @Override void onBegin(); @Override void onSuccess(); @Override void onFailure(); @Override void onInterruption();  }