ContentStore extends Store { @Override public void onAction(Action action) { if (action.getType().equals(ActionType.CONTENT_CHANGED)) { ContentAction contentAction = (ContentAction) action; content = contentAction.getContent(); notifyChange(); } }  @Override void onAction(Action action); Content getContent();  }
@Test public void testOnAction() throws Exception { final ContentStore contentStore = new ContentStore(); final View view = mock(View.class); contentStore.registerView(view); verifyZeroInteractions(view); contentStore.onAction(new MenuAction(MenuItem.PRODUCTS)); verifyZeroInteractions(view); contentStore.onAction(new ContentAction(Content.COMPANY)); verify(view, times(1)).storeChanged(eq(contentStore)); verifyNoMoreInteractions(view); assertEquals(Content.COMPANY, contentStore.getContent()); }