PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> { void validate(final KiePMMLModel toValidate) { if (!(toValidate instanceof KiePMMLMiningModel)) { throw new KiePMMLModelException(String.format(EXPECTED_A_KIE_PMMLMINING_MODEL_RECEIVED, toValidate.getClass().getName())); } validateMining((KiePMMLMiningModel) toValidate); }  @Override PMML_MODEL getPMMLModelType(); @Override PMML4Result evaluate(final KieBase knowledgeBase,
                                final KiePMMLMiningModel model,
                                final PMMLContext pmmlContext);  }
@Test public void validateKiePMMLMiningModel() { String name = "NAME"; KiePMMLMiningModel kiePMMLMiningModel = KiePMMLMiningModel.builder(name, Collections.emptyList(), MINING_FUNCTION.ASSOCIATION_RULES) .withTargetField("TARGET") .build(); evaluator.validate(kiePMMLMiningModel); }
@Test(expected = KiePMMLModelException.class) public void validateNoKiePMMLMiningModel() { String name = "NAME"; KiePMMLModel kiePMMLModel = new KiePMMLModel(name, Collections.emptyList()) { @Override public Object evaluate(Object knowledgeBase, Map<String, Object> requestData) { return null; } }; evaluator.validate(kiePMMLModel); }