@Test public void testOnAction() throws Exception { final MenuStore menuStore = new MenuStore(); final View view = mock(View.class); menuStore.registerView(view); verifyZeroInteractions(view); menuStore.onAction(new ContentAction(Content.COMPANY)); verifyZeroInteractions(view); menuStore.onAction(new MenuAction(MenuItem.PRODUCTS)); verify(view, times(1)).storeChanged(eq(menuStore)); verifyNoMoreInteractions(view); assertEquals(MenuItem.PRODUCTS, menuStore.getSelected()); }
@Override public void onAction(Action action) { if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) { MenuAction menuAction = (MenuAction) action; selected = menuAction.getMenuItem(); notifyChange(); } }
MenuStore extends Store { @Override public void onAction(Action action) { if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) { MenuAction menuAction = (MenuAction) action; selected = menuAction.getMenuItem(); notifyChange(); } } }
MenuStore extends Store { @Override public void onAction(Action action) { if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) { MenuAction menuAction = (MenuAction) action; selected = menuAction.getMenuItem(); notifyChange(); } }  }
MenuStore extends Store { @Override public void onAction(Action action) { if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) { MenuAction menuAction = (MenuAction) action; selected = menuAction.getMenuItem(); notifyChange(); } }  @Override void onAction(Action action); MenuItem getSelected(); }
MenuStore extends Store { @Override public void onAction(Action action) { if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) { MenuAction menuAction = (MenuAction) action; selected = menuAction.getMenuItem(); notifyChange(); } }  @Override void onAction(Action action); MenuItem getSelected();  }