/** * If the <code>FactIdentifier</code> of the given <code>FactMapping</code> equals the one at <b>index</b>, update the <code>FactMapping.FactAlias</code> at <b>index</b> * position with the provided <b>value</b> * @param simulationDescriptor * @param factMappingReference * @param index * @param value */ protected void updateFactMapping(SimulationDescriptor simulationDescriptor, FactMapping factMappingReference, int index, String value) { final FactIdentifier factIdentifierReference = factMappingReference.getFactIdentifier(); FactMapping factMappingToCheck = simulationDescriptor.getFactMappingByIndex(index); final FactIdentifier factIdentifierToCheck = factMappingToCheck.getFactIdentifier(); if (Objects.equals(FactIdentifier.EMPTY, factIdentifierReference)) { if (Objects.equals(factIdentifierToCheck, factIdentifierReference) && Objects.equals(factMappingReference.getFactAlias(), factMappingToCheck.getFactAlias())) { ((ScenarioGridColumn) columns.get(index)).getInformationHeaderMetaData().setTitle(value); factMappingToCheck.setFactAlias(value); } } else if (Objects.equals(factIdentifierToCheck, factIdentifierReference)) { ((ScenarioGridColumn) columns.get(index)).getInformationHeaderMetaData().setTitle(value); factMappingToCheck.setFactAlias(value); } }
scenarioGridModel.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, VALUE); verify(informationHeaderMetaDataMock, times(1)).setTitle(eq(VALUE)); verify(factMappingToCheck, times(1)).setFactAlias(eq(VALUE)); reset(informationHeaderMetaDataMock); reset(factMappingToCheck); scenarioGridModel.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, VALUE); verify(informationHeaderMetaDataMock, never()).setTitle(eq(VALUE)); verify(factMappingToCheck, never()).setFactAlias(eq(VALUE)); reset(informationHeaderMetaDataMock); reset(factMappingToCheck); scenarioGridModel.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, VALUE); verify(informationHeaderMetaDataMock, never()).setTitle(eq(VALUE)); verify(factMappingToCheck, never()).setFactAlias(eq(VALUE)); reset(informationHeaderMetaDataMock); reset(factMappingToCheck); scenarioGridModel.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, VALUE); verify(informationHeaderMetaDataMock, times(1)).setTitle(eq(VALUE)); verify(factMappingToCheck, times(1)).setFactAlias(eq(VALUE)); reset(informationHeaderMetaDataMock); reset(factMappingToCheck); scenarioGridModel.updateFactMapping(simulationDescriptorMock, factMappingReference, INDEX, VALUE); verify(informationHeaderMetaDataMock, never()).setTitle(eq(VALUE)); verify(factMappingToCheck, never()).setFactAlias(eq(VALUE));
IntStream.range(instanceLimits.getMinRowIndex(), instanceLimits.getMaxRowIndex() + 1) .filter(currentIndex -> currentIndex != columnIndex) .forEach(currentIndex -> simulationDescriptor.getFactMappingByIndex(currentIndex).setFactAlias(createdFactMapping.getFactAlias())); selectColumn(columns.indexOf(column)); } catch (Throwable t) {