@Test
public void addMissingValuesReplacements() {

    Map<String, Object> missingValueReplacementMap = new HashMap<>();
    missingValueReplacementMap.put("fieldA", "one");
    missingValueReplacementMap.put("fieldB", 2);
    KiePMMLTestingModel model = KiePMMLTestingModel.builder("TESTINGMODEL", Collections.emptyList(), MINING_FUNCTION.REGRESSION)
            .withMissingValueReplacementMap(missingValueReplacementMap)
            .build();
    PMMLRequestData pmmlRequestData = new PMMLRequestData("123", "modelName");
    pmmlRequestData.addRequestParam("age", 123);
    pmmlRequestData.addRequestParam("work", "work");
    PMMLContext pmmlContext = new PMMLContextImpl(pmmlRequestData);
    missingValueReplacementMap.keySet().forEach(key -> {
        assertFalse(pmmlContext.getRequestData().getMappedRequestParams().containsKey(key));
        assertFalse(pmmlContext.getMissingValueReplacedMap().containsKey(key));
    });
    pmmlRuntime.addMissingValuesReplacements(model, pmmlContext);
    missingValueReplacementMap.forEach((key, value) -> {
        assertTrue(pmmlContext.getRequestData().getMappedRequestParams().containsKey(key));
        final ParameterInfo<?> parameterInfo = pmmlContext.getRequestData().getMappedRequestParams().get(key);
        assertEquals(key, parameterInfo.getName());
        assertEquals(value.getClass(), parameterInfo.getType());
        assertEquals(value, parameterInfo.getValue());
        assertTrue(pmmlContext.getMissingValueReplacedMap().containsKey(key));
        assertEquals(value, pmmlContext.getMissingValueReplacedMap().get(key));
    });
}