@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());
}