PMMLStep getStep(final KiePMMLSegment segment, final PMML4Result pmml4Result) {
        PMMLStep toReturn = new PMMLMiningModelStep();
        toReturn.addInfo("SEGMENT", segment.getName());
        toReturn.addInfo("MODEL", segment.getModel().getName());
        toReturn.addInfo("RESULT CODE", pmml4Result.getResultCode());
        if (ResultCode.OK.getName().equals(pmml4Result.getResultCode())) {
            toReturn.addInfo("RESULT", pmml4Result.getResultVariables().get(pmml4Result.getResultObjectName()));
        }
        return toReturn;
    }
@Test
    void getStep() {
        final String modelName = "MODEL_NAME";
        KiePMMLModel modelMock = mock(KiePMMLModel.class);
        when(modelMock.getName()).thenReturn(modelName);
        final String segmentName = "SEGMENT_NAME";
        KiePMMLSegment segmentMock = mock(KiePMMLSegment.class);
        when(segmentMock.getName()).thenReturn(segmentName);
        when(segmentMock.getModel()).thenReturn(modelMock);
        final String resultObjectName = "RESULT_OBJECT_NAME";
        final String resultObjectValue = "RESULT_OBJECT_VALUE";
        ResultCode resultCode = OK;
        PMML4Result pmml4Result = new PMML4Result();
        pmml4Result.setResultCode(resultCode.getName());
        pmml4Result.setResultObjectName(resultObjectName);
        pmml4Result.getResultVariables().put(resultObjectName, resultObjectValue);
        PMMLStep retrieved = evaluator.getStep(segmentMock, pmml4Result);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).isInstanceOf(PMMLMiningModelStep.class);
        Map<String, Object> retrievedInfo = retrieved.getInfo();
        assertThat(retrievedInfo).isNotNull();
        assertThat(retrievedInfo.get("SEGMENT")).isEqualTo(segmentName);
        assertThat(retrievedInfo.get("MODEL")).isEqualTo(modelName);
        assertThat(retrievedInfo.get("RESULT CODE")).isEqualTo(resultCode.getName());
        assertThat(retrievedInfo.get("RESULT")).isEqualTo(resultObjectValue);

        resultCode = FAIL;
        pmml4Result = new PMML4Result();
        pmml4Result.setResultCode(resultCode.getName());
        retrieved = evaluator.getStep(segmentMock, pmml4Result);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).isInstanceOf(PMMLMiningModelStep.class);
        retrievedInfo = retrieved.getInfo();
        assertThat(retrievedInfo).isNotNull();
        assertThat(retrievedInfo.get("SEGMENT")).isEqualTo(segmentName);
        assertThat(retrievedInfo.get("MODEL")).isEqualTo(modelName);
        assertThat(retrievedInfo.get("RESULT CODE")).isEqualTo(resultCode.getName());
        assertThat(retrievedInfo).doesNotContainKey("RESULT");
    }