@Test public void addToScenarioRecursive() { FactMapping factMappingMock = mock(FactMapping.class); KogitoScenarioSimulationBuilder.FactMappingExtractor factMappingExtractorMock = mock(KogitoScenarioSimulationBuilder.FactMappingExtractor.class); when(factMappingExtractorMock.getFactMapping(any(), anyString(), any(), anyString())).thenReturn(factMappingMock); Map<String, FactModelTree> hiddenFacts = new HashMap<>(); FactModelTree factModelTree = new FactModelTree("myFact", "", new HashMap<>(), Collections.emptyMap()); factModelTree.addExpandableProperty("recursiveProperty", "recursive"); String propertyType = String.class.getCanonicalName(); String propertyName = "simpleProperty"; factModelTree.addSimpleProperty(propertyName, new FactModelTree.PropertyTypeName(propertyType)); hiddenFacts.put("recursive", factModelTree); kogitoScenarioSimulationBuilderSpy.addFactMapping(factMappingExtractorMock, factModelTree, new ArrayList<>(), hiddenFacts); verify(factMappingExtractorMock, times(1)) .getFactMapping( eq(factModelTree), eq(propertyName), eq(Arrays.asList("myFact", "recursiveProperty")), eq(propertyType)); verify(factMappingExtractorMock, times(2)) .getFactMapping( any(), any(), any(), any()); }
protected void addFactMapping(final FactMappingExtractor factMappingExtractor, final FactModelTree factModelTree, final List<String> previousSteps, final Map<String, FactModelTree> hiddenValues) { internalAddToScenario(factMappingExtractor, factModelTree, previousSteps, hiddenValues, new HashSet<>()); }
KogitoScenarioSimulationBuilder { protected void addFactMapping(final FactMappingExtractor factMappingExtractor, final FactModelTree factModelTree, final List<String> previousSteps, final Map<String, FactModelTree> hiddenValues) { internalAddToScenario(factMappingExtractor, factModelTree, previousSteps, hiddenValues, new HashSet<>()); } }
KogitoScenarioSimulationBuilder { protected void addFactMapping(final FactMappingExtractor factMappingExtractor, final FactModelTree factModelTree, final List<String> previousSteps, final Map<String, FactModelTree> hiddenValues) { internalAddToScenario(factMappingExtractor, factModelTree, previousSteps, hiddenValues, new HashSet<>()); }  }
KogitoScenarioSimulationBuilder { protected void addFactMapping(final FactMappingExtractor factMappingExtractor, final FactModelTree factModelTree, final List<String> previousSteps, final Map<String, FactModelTree> hiddenValues) { internalAddToScenario(factMappingExtractor, factModelTree, previousSteps, hiddenValues, new HashSet<>()); }  void populateScenarioSimulationModel(final ScenarioSimulationModel content, final ScenarioSimulationModel.Type type, final String value, RemoteCallback<String> callback); }
KogitoScenarioSimulationBuilder { protected void addFactMapping(final FactMappingExtractor factMappingExtractor, final FactModelTree factModelTree, final List<String> previousSteps, final Map<String, FactModelTree> hiddenValues) { internalAddToScenario(factMappingExtractor, factModelTree, previousSteps, hiddenValues, new HashSet<>()); }  void populateScenarioSimulationModel(final ScenarioSimulationModel content, final ScenarioSimulationModel.Type type, final String value, RemoteCallback<String> callback);  }