OrderPresenter extends PresenterWidget<OrderPresenter.MyView> implements OrderUiHandlers, ShoppingCartChangedEventHandler, ShoppingCartQuantityUpdatedEventHandler,
        CheckoutEventHandler, EmptyCartEventHandler { @Override public void onCheckout(CheckoutEvent event) { if (event.isCheckoutOpen()) { setInSlot(SLOT_CART_ITEMS, cartItemsPresenter); } } @Inject  OrderPresenter(
            EventBus eventBus,
            MyView view,
            CartItemsPresenter cartItemsPresenter,
            CurrentOrder currentOrder,
            CurrencyFormat currencyFormat); @Override void onEmptyCart(EmptyCartEvent event); @Override void onCheckout(CheckoutEvent event); @Override void onContinueClicked(); @Override void setShippingMethod(ShippingMethod shippingMethod); @Override void onShoppingCartChanged(ShoppingCartChangedEvent event); @Override void onShoppingCartQuantityChanged(ShoppingCartQuantityChangeEvent event); static final SingleSlot<CartItemsPresenter> SLOT_CART_ITEMS; }
@Test public void onCheckout_whenCheckoutIsClosed_shouldBeSetInSlot() throws Exception { CheckoutEvent event = new CheckoutEvent(CheckoutEvent.Status.CLOSE); presenter.onCheckout(event); assertNotNull(presenter.getChild(OrderPresenter.SLOT_CART_ITEMS)); }
@Test public void onCheckout_whenCheckoutIsOpen_shouldBeRemovedFromSlot() throws Exception { CheckoutEvent event = new CheckoutEvent(CheckoutEvent.Status.OPEN); presenter.onCheckout(event); assertNull(presenter.getChild(OrderPresenter.SLOT_CART_ITEMS)); }