PmmlPredictionModel implements PredictionModel { @Override public PMMLContext newContext(Map<String, Object> variables) { final PMMLRequestData pmmlRequestData = getPMMLRequestData(pmmlModel.getName(), variables); return new PMMLContextImpl(pmmlRequestData); } PmmlPredictionModel(PMMLRuntime pmmlRuntime, String modelName); @Override PMMLContext newContext(Map<String, Object> variables); @Override PMML4Result evaluateAll(PMMLContext context); @Override KiePMMLModel getKiePMMLModel();  }
@Test void newContext() { final Map<String, Object> parameters = getParameters(); PMMLContext retrieved = pmmlPredictionModel.newContext(parameters); assertNotNull(retrieved); PMMLRequestData pmmlRequestData = retrieved.getRequestData(); assertNotNull(retrieved); assertEquals(MODEL_NAME, pmmlRequestData.getModelName()); final Map<String, ParameterInfo> parameterInfos = pmmlRequestData.getMappedRequestParams(); assertEquals(parameters.size(), parameterInfos.size()); parameters.forEach((key, value) -> { assertTrue(parameterInfos.containsKey(key)); ParameterInfo parameterInfo = parameterInfos.get(key); assertEquals(value, parameterInfo.getValue()); assertEquals(value.getClass(), parameterInfo.getType()); }); }