@Test public void testOnNotificationToolbarDeleteAllClicked() { NotificationToolbarDeleteAllClickedEvent eventMock = mock(NotificationToolbarDeleteAllClickedEvent.class); uut.onNotificationToolbarDeleteAllClicked(eventMock); verify(viewMock).mask(); verify(messageServiceFacadeMock).deleteAll(eq(currentCategoryMock), asyncCallbackStringCaptor.capture()); AsyncCallback<String> asyncCallback = asyncCallbackStringCaptor.getValue(); asyncCallback.onSuccess("result"); verify(viewMock).unmask(); verify(viewMock).loadNotifications(eq(viewMock.getCurrentLoadConfig())); verify(eventBusMock).fireEvent(isA(DeleteNotificationsUpdateEvent.class)); }
@Override public void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) { view.mask(); messageServiceFacade.deleteAll(currentCategory, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmask(); } @Override public void onSuccess(String result) { view.unmask(); view.loadNotifications(view.getCurrentLoadConfig()); DeleteNotificationsUpdateEvent event = new DeleteNotificationsUpdateEvent(null); eventBus.fireEvent(event); } }); }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) { view.mask(); messageServiceFacade.deleteAll(currentCategory, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmask(); } @Override public void onSuccess(String result) { view.unmask(); view.loadNotifications(view.getCurrentLoadConfig()); DeleteNotificationsUpdateEvent event = new DeleteNotificationsUpdateEvent(null); eventBus.fireEvent(event); } }); } }
NotificationPresenterImpl implements NotificationView.Presenter,
                                                  NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
                                                  NotificationSelectionEvent.NotificationSelectionEventHandler,
                                                  NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
                                                  NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
                                                  NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler { @Override public void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) { view.mask(); messageServiceFacade.deleteAll(currentCategory, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmask(); } @Override public void onSuccess(String result) { view.unmask(); view.loadNotifications(view.getCurrentLoadConfig()); DeleteNotificationsUpdateEvent event = new DeleteNotificationsUpdateEvent(null); eventBus.fireEvent(event); } }); } @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 onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) { view.mask(); messageServiceFacade.deleteAll(currentCategory, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmask(); } @Override public void onSuccess(String result) { view.unmask(); view.loadNotifications(view.getCurrentLoadConfig()); DeleteNotificationsUpdateEvent event = new DeleteNotificationsUpdateEvent(null); eventBus.fireEvent(event); } }); } @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 onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) { view.mask(); messageServiceFacade.deleteAll(currentCategory, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmask(); } @Override public void onSuccess(String result) { view.unmask(); view.loadNotifications(view.getCurrentLoadConfig()); DeleteNotificationsUpdateEvent event = new DeleteNotificationsUpdateEvent(null); eventBus.fireEvent(event); } }); } @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();  }