@Test
public void validateSimulationStructure() {

    Simulation simulation = new Simulation();
    Settings settings = new Settings();
    ScenarioValidationService scenarioValidationServiceSpy = spy(new ScenarioValidationService() {
        @Override
        protected List<FactMappingValidationError> validateDMN(Simulation simulation, Settings settings, KieContainer kieContainer) {
            return Collections.emptyList();
        }
        @Override
        protected List<FactMappingValidationError> validateRULE(Simulation simulation, Settings settings, KieContainer kieContainer) {
            return Collections.emptyList();
        }
        @Override
        protected KieContainer getKieContainer(Path path) {
            return kieContainerMock;
        }
    });
    settings.setType(ScenarioSimulationModel.Type.DMN);
    scenarioValidationServiceSpy.validateSimulationStructure(simulation, settings, pathMock);
    verify(scenarioValidationServiceSpy, never()).validateDMN(eq(simulation), eq(settings), eq(kieContainerMock));
    verify(scenarioValidationServiceSpy, never()).validateRULE(eq(simulation), eq(settings), eq(kieContainerMock));
    reset(scenarioValidationServiceSpy);
    FactMapping sampleFactMapping = simulation.getScesimModelDescriptor()
            .addFactMapping(FactIdentifier.create("sample", String.class.getCanonicalName()),
                            ExpressionIdentifier.create("sample", FactMappingType.GIVEN));
    sampleFactMapping.addExpressionElement("sample", String.class.getCanonicalName());
    settings.setType(ScenarioSimulationModel.Type.DMN);
    scenarioValidationServiceSpy.validateSimulationStructure(simulation, settings, pathMock);
    verify(scenarioValidationServiceSpy, timeout(1)).validateDMN(eq(simulation), eq(settings), eq(kieContainerMock));
    reset(scenarioValidationServiceSpy);
    settings.setType(ScenarioSimulationModel.Type.RULE);
    scenarioValidationServiceSpy.validateSimulationStructure(simulation, settings, pathMock);
    verify(scenarioValidationServiceSpy, timeout(1)).validateRULE(eq(simulation), eq(settings), eq(kieContainerMock));
    settings.setType(null);
    assertThatThrownBy(() -> scenarioValidationServiceSpy.validateSimulationStructure(simulation, settings, pathMock))
            .isInstanceOf(IllegalArgumentException.class);
}