ViewHideAlertsButtonPresenter { @PostConstruct public void init() { view.init(this); final boolean isAlertsActive = PlaceStatus.OPEN.equals(placeManager.getStatus(MessageConsoleScreen.ALERTS)); view.setAlertsActive(isAlertsActive); placeManager.registerOnOpenCallback(new DefaultPlaceRequest(MessageConsoleScreen.ALERTS), () -> view.setAlertsActive(true)); placeManager.registerOnCloseCallback(new DefaultPlaceRequest(MessageConsoleScreen.ALERTS), () -> view.setAlertsActive(false)); } @Inject  ViewHideAlertsButtonPresenter(final PlaceManager placeManager,
                                         final View view); @PostConstruct void init(); void addCssClassToButtons(final String cssClass); void viewAlerts(); void hideAlerts(); View getView();  }
@Test public void initTest() { presenter.init(); verify(view).init(presenter); verify(view).setAlertsActive(anyBoolean()); verify(placeManager).registerOnOpenCallback(eq(new DefaultPlaceRequest(MessageConsoleScreen.ALERTS)), any()); verify(placeManager).registerOnCloseCallback(eq(new DefaultPlaceRequest(MessageConsoleScreen.ALERTS)), any()); }