@Test
public void getPMML4ResultOK() {

    String name = "NAME";
    String targetField = "TARGET";
    String prediction = "FIRST_VALUE";
    final Map<String, Object> outputFieldsMap = new HashMap<>();
    IntStream.range(0,3).forEach(index -> {
        outputFieldsMap.put("KEY_" + index, "OBJECT_" + index);
    });
    KiePMMLSegmentation kiePMMLSegmentation = KiePMMLSegmentation.builder("SEGM_1", Collections.emptyList(), SELECT_FIRST).build();
    KiePMMLMiningModel kiePMMLMiningModel = KiePMMLMiningModel.builder(name, Collections.emptyList(),
                                                                       MINING_FUNCTION.ASSOCIATION_RULES)
            .withTargetField(targetField)
            .withSegmentation(kiePMMLSegmentation)
            .withOutputFieldsMap(outputFieldsMap)
            .build();
    final LinkedHashMap<String, KiePMMLNameValue> inputData = new LinkedHashMap<>();
    inputData.put("FIRST_KEY", new KiePMMLNameValue("FIRST_NAME", prediction));
    inputData.put("SECOND_KEY", new KiePMMLNameValue("SECOND_NAME", "SECOND_VALUE"));
    PMML4Result retrieved = evaluator.getPMML4Result(kiePMMLMiningModel, inputData);
    assertNotNull(retrieved);
    assertEquals(OK.getName(), retrieved.getResultCode());
    assertEquals(targetField, retrieved.getResultObjectName());
    final Map<String, Object> resultVariables = retrieved.getResultVariables();
    assertTrue(resultVariables.containsKey(targetField));
    assertEquals(prediction, resultVariables.get(targetField));
    outputFieldsMap.forEach((key, value) -> {
        assertTrue(resultVariables.containsKey(key));
        assertEquals(value, resultVariables.get(key));
    });
}