ScenarioGrid extends BaseGridWidget { public void setContent(AbstractScesimModel abstractScesimModel, ScenarioSimulationModel.Type type) { this.type = type; ((AbstractScesimGridModel) model).clear(); ((AbstractScesimGridModel) model).bindContent(abstractScesimModel); setHeaderColumns(abstractScesimModel, type); appendRows(abstractScesimModel); ((AbstractScesimGridModel) model).loadFactMappingsWidth(); ((AbstractScesimGridModel) model).forceRefreshWidth(); } ScenarioGrid(AbstractScesimGridModel model,
                        ScenarioGridLayer scenarioGridLayer,
                        ScenarioGridRenderer renderer,
                        ScenarioContextMenuRegistry scenarioContextMenuRegistry); void setContent(AbstractScesimModel abstractScesimModel, ScenarioSimulationModel.Type type); GridWidget getGridWidget(); EventBus getEventBus(); void setEventBus(EventBus eventBus); void setDefaultSelectedDataCell(int cellX, int cellY); ScenarioSimulationContext getScenarioSimulationContext(); void setScenarioSimulationContext(ScenarioSimulationContext scenarioSimulationContext); @Override AbstractScesimGridModel getModel(); ScenarioSimulationModel.Type getType(); void clearSelections(); void setSelectedColumn(int columnIndex); void setSelectedColumnAndHeader(int headerRowIndex, int columnIndex); void ensureCellIsSelected(); void setSelectedCell(int rowIndex, int columnIndex); @Override boolean adjustSelection(final SelectionExtension direction, final boolean isShiftKeyDown);  }
@Test public void setContent() { InOrder callsOrder = inOrder(scenarioGridModelMock, scenarioGridSpy); scenarioGridSpy.setContent(simulation, ScenarioSimulationModel.Type.RULE); callsOrder.verify(scenarioGridModelMock, times(1)).clear(); callsOrder.verify(scenarioGridModelMock, times(1)).bindContent(eq(simulation)); callsOrder.verify(scenarioGridSpy, times(1)).setHeaderColumns(eq(simulation), eq(ScenarioSimulationModel.Type.RULE)); callsOrder.verify(scenarioGridSpy, times(1)).appendRows(eq(simulation)); callsOrder.verify(scenarioGridModelMock, times(1)).loadFactMappingsWidth(); callsOrder.verify(scenarioGridModelMock, times(1)).forceRefreshWidth(); }