@Test public void testOnNotificationSelection_emptyListStore() { NotificationSelectionEvent eventMock = mock(NotificationSelectionEvent.class); when(eventMock.getNotifications()).thenReturn(listMock); when(listMock.size()).thenReturn(0); uut.onNotificationSelection(eventMock); verify(toolbarViewMock).setDeleteButtonEnabled(eq(false)); }
@Override public void onNotificationSelection(NotificationSelectionEvent event) { if (event.getNotifications() == null || event.getNotifications().size() == 0) { toolbar.setDeleteButtonEnabled(false); } else { toolbar.setDeleteButtonEnabled(true); } }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationSelection(NotificationSelectionEvent event) { if (event.getNotifications() == null || event.getNotifications().size() == 0) { toolbar.setDeleteButtonEnabled(false); } else { toolbar.setDeleteButtonEnabled(true); } } }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationSelection(NotificationSelectionEvent event) { if (event.getNotifications() == null || event.getNotifications().size() == 0) { toolbar.setDeleteButtonEnabled(false); } else { toolbar.setDeleteButtonEnabled(true); } } @Inject  NotificationPresenterImpl(final NotificationViewFactory viewFactory,
                                     NotificationView.NotificationViewAppearance appearance,
                                     NotificationToolbarView toolbar,
                                     NotificationMessageProperties messageProperties); }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationSelection(NotificationSelectionEvent event) { if (event.getNotifications() == null || event.getNotifications().size() == 0) { toolbar.setDeleteButtonEnabled(false); } else { toolbar.setDeleteButtonEnabled(true); } } @Inject  NotificationPresenterImpl(final NotificationViewFactory viewFactory,
                                     NotificationView.NotificationViewAppearance appearance,
                                     NotificationToolbarView toolbar,
                                     NotificationMessageProperties messageProperties); @Override void onNotificationGridRefresh(NotificationGridRefreshEvent event); @Override FilterPagingLoadConfig buildDefaultLoadConfig(); @Override void filterBy(NotificationCategory category); @Override void onNotificationSelection(NotificationSelectionEvent event); @Override void go(HasOneWidget container); @Override void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event); @Override void onNotificationToolbarDeleteClicked(NotificationToolbarDeleteClickedEvent event); @Override void onNotificationToolbarSelection(NotificationToolbarSelectionEvent event); @Override void setRefreshButton(TextButton refreshBtn); @Override NotificationCategory getCurrentCategory(); }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationSelection(NotificationSelectionEvent event) { if (event.getNotifications() == null || event.getNotifications().size() == 0) { toolbar.setDeleteButtonEnabled(false); } else { toolbar.setDeleteButtonEnabled(true); } } @Inject  NotificationPresenterImpl(final NotificationViewFactory viewFactory,
                                     NotificationView.NotificationViewAppearance appearance,
                                     NotificationToolbarView toolbar,
                                     NotificationMessageProperties messageProperties); @Override void onNotificationGridRefresh(NotificationGridRefreshEvent event); @Override FilterPagingLoadConfig buildDefaultLoadConfig(); @Override void filterBy(NotificationCategory category); @Override void onNotificationSelection(NotificationSelectionEvent event); @Override void go(HasOneWidget container); @Override void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event); @Override void onNotificationToolbarDeleteClicked(NotificationToolbarDeleteClickedEvent event); @Override void onNotificationToolbarSelection(NotificationToolbarSelectionEvent event); @Override void setRefreshButton(TextButton refreshBtn); @Override NotificationCategory getCurrentCategory();  }