KogitoScenarioSimulationBuilder { protected Simulation createRULESimulation() { Simulation toReturn = new Simulation(); ScesimModelDescriptor simulationDescriptor = toReturn.getScesimModelDescriptor(); FactMapping indexFactMapping = simulationDescriptor.addFactMapping(FactIdentifier.INDEX.getName(), FactIdentifier.INDEX, ExpressionIdentifier.INDEX); indexFactMapping.setColumnWidth(getColumnWidth(ExpressionIdentifier.INDEX.getName())); FactMapping descriptionFactMapping = simulationDescriptor.addFactMapping(FactIdentifier.DESCRIPTION.getName(), FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION); descriptionFactMapping.setColumnWidth(getColumnWidth(ExpressionIdentifier.DESCRIPTION.getName())); ScenarioWithIndex scenarioWithIndex = createScesimDataWithIndex(toReturn, ScenarioWithIndex::new); createEmptyColumn(simulationDescriptor, scenarioWithIndex, 1, GIVEN, simulationDescriptor.getFactMappings().size()); createEmptyColumn(simulationDescriptor, scenarioWithIndex, 2, EXPECT, simulationDescriptor.getFactMappings().size()); return toReturn; }  void populateScenarioSimulationModel(final ScenarioSimulationModel content, final ScenarioSimulationModel.Type type, final String value, RemoteCallback<String> callback);  }
@Test public void createRULESimulation() { Simulation simulation = kogitoScenarioSimulationBuilderSpy.createRULESimulation(); assertNotNull(simulation); assertEquals(1,simulation.getScenarioWithIndex().size()); ScesimModelDescriptor modelDescriptor = simulation.getScesimModelDescriptor(); assertNotNull(modelDescriptor); assertEquals(4, modelDescriptor.getFactMappings().size()); assertEquals(70, modelDescriptor.getFactMappingByIndex(0).getColumnWidth(), 0); assertEquals(FactIdentifier.INDEX.getName(), modelDescriptor.getFactMappingByIndex(0).getFactAlias()); assertEquals(FactIdentifier.INDEX, modelDescriptor.getFactMappingByIndex(0).getFactIdentifier()); assertEquals(ExpressionIdentifier.INDEX, modelDescriptor.getFactMappingByIndex(0).getExpressionIdentifier()); assertEquals(300, modelDescriptor.getFactMappingByIndex(1).getColumnWidth(), 0); assertEquals(FactIdentifier.DESCRIPTION.getName(), modelDescriptor.getFactMappingByIndex(1).getFactAlias()); assertEquals(FactIdentifier.DESCRIPTION, modelDescriptor.getFactMappingByIndex(1).getFactIdentifier()); assertEquals(ExpressionIdentifier.DESCRIPTION, modelDescriptor.getFactMappingByIndex(1).getExpressionIdentifier()); assertEquals(FactMappingValueType.NOT_EXPRESSION, modelDescriptor.getFactMappingByIndex(1).getFactMappingValueType()); assertEquals(114, modelDescriptor.getFactMappingByIndex(2).getColumnWidth(), 0); assertEquals("INSTANCE 1", modelDescriptor.getFactMappingByIndex(2).getFactAlias()); assertEquals(FactIdentifier.EMPTY, modelDescriptor.getFactMappingByIndex(2).getFactIdentifier()); assertEquals(ExpressionIdentifier.create("1|1", FactMappingType.GIVEN), modelDescriptor.getFactMappingByIndex(2).getExpressionIdentifier()); assertEquals(FactMappingValueType.NOT_EXPRESSION, modelDescriptor.getFactMappingByIndex(2).getFactMappingValueType()); assertEquals(114, modelDescriptor.getFactMappingByIndex(3).getColumnWidth(), 0); assertEquals("INSTANCE 2", modelDescriptor.getFactMappingByIndex(3).getFactAlias()); assertEquals(FactIdentifier.EMPTY, modelDescriptor.getFactMappingByIndex(3).getFactIdentifier()); assertEquals(ExpressionIdentifier.create("1|2", FactMappingType.EXPECT), modelDescriptor.getFactMappingByIndex(3).getExpressionIdentifier()); assertEquals(FactMappingValueType.NOT_EXPRESSION, modelDescriptor.getFactMappingByIndex(3).getFactMappingValueType()); }