@Test(expected = KiePMMLInternalException.class) public void validateMiningNoTargetField() { String name = "NAME"; KiePMMLMiningModel kiePMMLMiningModel = KiePMMLMiningModel.builder(name, Collections.emptyList(), MINING_FUNCTION.ASSOCIATION_RULES).build(); evaluator.validateMining(kiePMMLMiningModel); }
void validateMining(final KiePMMLMiningModel toValidate) { if (toValidate.getTargetField() == null || StringUtils.isEmpty(toValidate.getTargetField().trim())) { throw new KiePMMLInternalException(String.format(TARGET_FIELD_REQUIRED_RETRIEVED, toValidate.getTargetField())); } }
PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> { void validateMining(final KiePMMLMiningModel toValidate) { if (toValidate.getTargetField() == null || StringUtils.isEmpty(toValidate.getTargetField().trim())) { throw new KiePMMLInternalException(String.format(TARGET_FIELD_REQUIRED_RETRIEVED, toValidate.getTargetField())); } } }
PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> { void validateMining(final KiePMMLMiningModel toValidate) { if (toValidate.getTargetField() == null || StringUtils.isEmpty(toValidate.getTargetField().trim())) { throw new KiePMMLInternalException(String.format(TARGET_FIELD_REQUIRED_RETRIEVED, toValidate.getTargetField())); } }  }
PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> { void validateMining(final KiePMMLMiningModel toValidate) { if (toValidate.getTargetField() == null || StringUtils.isEmpty(toValidate.getTargetField().trim())) { throw new KiePMMLInternalException(String.format(TARGET_FIELD_REQUIRED_RETRIEVED, toValidate.getTargetField())); } }  @Override PMML_MODEL getPMMLModelType(); @Override PMML4Result evaluate(final KieBase knowledgeBase,
                                final KiePMMLMiningModel model,
                                final PMMLContext pmmlContext); }
PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> { void validateMining(final KiePMMLMiningModel toValidate) { if (toValidate.getTargetField() == null || StringUtils.isEmpty(toValidate.getTargetField().trim())) { throw new KiePMMLInternalException(String.format(TARGET_FIELD_REQUIRED_RETRIEVED, toValidate.getTargetField())); } }  @Override PMML_MODEL getPMMLModelType(); @Override PMML4Result evaluate(final KieBase knowledgeBase,
                                final KiePMMLMiningModel model,
                                final PMMLContext pmmlContext);  }