BrandChangeHandler implements NavigationHandler { @Override public void onNavigation(NavigationEvent navigationEvent) { String brandName = navigationEvent.getRequest().getParameter(NameTokens.PARAM_BRAND, ""); Brand brandValue = Brand.createFromValue(brandName); currentBrand.update(brandValue); } @Inject  BrandChangeHandler(
            EventBus eventBus,
            CurrentBrand currentBrand); @Override void onNavigation(NavigationEvent navigationEvent);  }
@Test public void onNavigation_whenBrandChanges_updatesCurrentBrand() { Brand brand = Brand.ARCBEES; PlaceRequest request = new PlaceRequest.Builder() .with(NameTokens.PARAM_BRAND, brand.getValue()) .build(); NavigationEvent navigationEvent = new NavigationEvent(request); handler.onNavigation(navigationEvent); verify(currentBrand).update(brand); }
@Test public void onNavigation_whenBrandChanges_updatesCurrentBrand2() { Brand brand = Brand.CHOSEN; PlaceRequest request = new PlaceRequest.Builder() .with(NameTokens.PARAM_BRAND, brand.getValue()) .build(); NavigationEvent navigationEvent = new NavigationEvent(request); handler.onNavigation(navigationEvent); verify(currentBrand).update(brand); }