ApplicationPresenter extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> implements BrandChangedEventHandler, NavigationHandler, ShoppingCartChangedEventHandler,
        CloseShoppingCartEventHandler, ShoppingCartQuantityUpdatedEventHandler, PageScrollEventHandler { @ProxyEvent @Override public void onNavigation(NavigationEvent navigationEvent) { String newNameToken = navigationEvent.getRequest().getNameToken(); if (NameTokens.matchesAnyLanguageOfNameToken(newNameToken, NameTokens.HOME)) { getView().setHomeAnchorActive(); } else if (NameTokens.matchesAnyLanguageOfNameToken(newNameToken, NameTokens.PRODUCT)) { getView().setProductAnchorActive(); } getView().updateNavigationHref(); } @Inject  ApplicationPresenter(
            EventBus eventBus,
            MyView view,
            MyProxy proxy,
            SidePanelPresenter sidePanelPresenter,
            CurrentOrder currentOrder,
            ShoppingCartLocalStorage shoppingCartLocalStorage); @Override void onCloseShoppingCart(CloseShoppingCartEvent event); @Override void onShoppingCartQuantityChanged(ShoppingCartQuantityChangeEvent event); @Override void onPageScrollEnabled(PageScrollEvent event); @Override void onPageScrollDisabled(PageScrollEvent event); @ProxyEvent @Override void onBrandChanged(BrandChangedEvent event); @Override void onShoppingCartChanged(ShoppingCartChangedEvent event); @ProxyEvent @Override void onNavigation(NavigationEvent navigationEvent); static final NestedSlot SLOT_MAIN; static final SingleSlot SLOT_SIDE_PANEL; }
@Test public void onNavigation_updateLanguageSwitchAnchors() { PlaceRequest request = new PlaceRequest.Builder().nameToken(NameTokens.PRODUCT).build(); NavigationEvent event = new NavigationEvent(request); presenter.onNavigation(event); verify(view).updateNavigationHref(); }
@Test public void onNavigation_setActiveTab_whenNameTokenMatchesFrench() { PlaceRequest request = new PlaceRequest.Builder().nameToken(NameTokens.PRODUCT).build(); NavigationEvent event = new NavigationEvent(request); presenter.onNavigation(event); verify(view).setProductAnchorActive(); }
@Test public void onNavigation_setActiveTab_whenNameTokenMatchesEnglish() { PlaceRequest request = new PlaceRequest.Builder().nameToken(NameTokens.PRODUCT_FR).build(); NavigationEvent event = new NavigationEvent(request); presenter.onNavigation(event); verify(view).setProductAnchorActive(); }