@Test public void onSuccessRaisesMessageIfNoUnseenMessagesAndShowMessagesIsTrue() { when(reviewDAO.unseen()).thenReturn(new ArrayList<Review>()); listener.onSuccess(); verify(invoker, times(1)).invokeMessageBox("No new code reviews."); verifyNoMoreInteractions(invoker); }
@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();  }