use of org.kie.pmml.models.mining.compiler.HasKnowledgeBuilderMock in project drools by kiegroup.
the class KiePMMLSegmentationFactoryTest method getSegmentationSourcesMap.
@Test
public void getSegmentationSourcesMap() {
final List<KiePMMLModel> nestedModels = new ArrayList<>();
final CommonCompilationDTO<MiningModel> source = CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME, pmml, MINING_MODEL, new HasKnowledgeBuilderMock(KNOWLEDGE_BUILDER));
final MiningModelCompilationDTO compilationDTO = MiningModelCompilationDTO.fromCompilationDTO(source);
final Map<String, String> retrieved = KiePMMLSegmentationFactory.getSegmentationSourcesMap(compilationDTO, nestedModels);
assertNotNull(retrieved);
int expectedNestedModels = MINING_MODEL.getSegmentation().getSegments().size();
assertEquals(expectedNestedModels, nestedModels.size());
}
Aggregations