use of org.kie.api.pmml.ParameterInfo in project drools by kiegroup.
the class MiningSegmentTransferTest method testComplexResult.
@Test
public void testComplexResult() {
MiningSegmentTransfer mst = new MiningSegmentTransfer(complexResult, "SEGMENT_2");
mst.addResultToRequestMapping("firstObject", "object1");
mst.addResultToRequestMapping("myComplex.varA", "stringFromMyComplex");
mst.addResultToRequestMapping("myComplex.varB", "intValue");
doBaselineAssertions(complexResult, mst);
assertEquals(3, mst.getResultFieldNameToRequestFieldName().size());
PMMLRequestData rqst = mst.getOutboundRequest();
assertNotNull(rqst);
assertEquals(complexResult.getCorrelationId(), rqst.getCorrelationId());
Map<String, ParameterInfo> params = rqst.getMappedRequestParams();
assertEquals(complexResult.getResultValue("firstObject", null), params.get("object1").getValue());
assertEquals(complexResult.getResultValue("myComplex", "varA"), params.get("stringFromMyComplex").getValue());
assertEquals(complexResult.getResultValue("myComplex", "varB"), params.get("intValue").getValue());
System.out.println(rqst);
System.out.println(complexResult);
}
Aggregations