ScenarioSimulationMainGridPanelClickHandler extends AbstractScenarioSimulationGridPanelHandler implements ScenarioSimulationGridPanelClickHandler { @Override @SuppressWarnings("unchecked") public void onContextMenu(final ContextMenuEvent event) { scenarioContextMenuRegistry.hideMenus(); if (scenarioContextMenuRegistry.manageRightClick(scenarioGrid, event)) { scenarioContextMenuRegistry.hideErrorReportPopover(); event.preventDefault(); event.stopPropagation(); } }  void setScenarioContextMenuRegistry(ScenarioContextMenuRegistry scenarioContextMenuRegistry); @Override void setEventBus(EventBus eventBus); @Override void onClick(ClickEvent event); @Override @SuppressWarnings("unchecked") void onContextMenu(final ContextMenuEvent event); @Override void hideMenus();  }
@Test public void onContextMenu() { doReturn(true).when(scenarioContextMenuRegistryMock).manageRightClick(scenarioGridMock, contextMenuEventMock); scenarioSimulationMainGridPanelClickHandler.onContextMenu(contextMenuEventMock); verify(contextMenuEventMock, times(1)).preventDefault(); verify(contextMenuEventMock, times(1)).stopPropagation(); verify(scenarioContextMenuRegistryMock, times(1)).hideMenus(); }