NotificationManagerImpl extends BasePresenter implements NotificationManager,
                                                                      NotificationItem.ActionDelegate,
                                                                      Notification.NotificationObserver,
                                                                      NotificationManagerView.ActionDelegate,
                                                                      NotificationMessageStack.ActionDelegate,
                                                                      HasView { @Override public void onCloseMessageClicked(@NotNull Notification notification) { notification.setState(READ); onCloseClicked(notification); } @Inject  NotificationManagerImpl(EventBus eventBus,
                                   NotificationManagerView view,
                                   DialogFactory dialogFactory,
                                   final NotificationContainer notificationContainer,
                                   final NotificationMessageStack notificationMessageStack); @Override View getView(); @Override void onValueChanged(); @Override void showNotification(@NotNull Notification notification); @Override void showInfo(@NotNull String message); @Override void showWarning(@NotNull String message); @Override void showError(@NotNull String message); void removeNotification(@NotNull Notification notification); @Override void onOpenMessageClicked(@NotNull Notification notification); @Override void onOpenItemClicked(@NotNull Notification notification); @Override void onCloseMessageClicked(@NotNull Notification notification); @Override void onCloseItemClicked(@NotNull Notification notification); @NotNull @Override String getTitle(); @Nullable @Override ImageResource getTitleImage(); @Nullable @Override SVGResource getTitleSVGImage(); @Override IsWidget getTitleWidget(); @Nullable @Override String getTitleToolTip(); @Override void go(AcceptsOneWidget container);  }
@Test public void testOnCloseMessageClicked() throws Exception { Notification.CloseNotificationHandler closeNotificationHandler = mock(Notification.CloseNotificationHandler.class); Notification notification = new Notification("test message", INFO, closeNotificationHandler); manager.showNotification(notification); reset(view); manager.onCloseMessageClicked(notification); verify(closeNotificationHandler).onCloseClicked(); verify(view).setNotificationCount(eq(0)); }