@Test
public void setConstructor() {

    ConstructorDeclaration constructorDeclaration = MODEL_TEMPLATE.getDefaultConstructor().get();
    String generatedClassName = "GeneratedClassName";
    String nestedTable = "NestedTable";
    String targetField = "targetField";
    MINING_FUNCTION miningFunction = MINING_FUNCTION.CLASSIFICATION;
    String modelName = "modelName";
    KiePMMLRegressionModelFactory.setConstructor(generatedClassName,
                                                 nestedTable,
                                                 constructorDeclaration,
                                                 targetField,
                                                 miningFunction,
                                                 modelName);
    Map<Integer, Expression> superInvocationExpressionsMap = new HashMap<>();
    superInvocationExpressionsMap.put(0, new NameExpr(String.format("\"%s\"", modelName)));
    Map<String, Expression> assignExpressionMap = new HashMap<>();
    assignExpressionMap.put("targetField", new StringLiteralExpr(targetField));
    assignExpressionMap.put("miningFunction", new NameExpr(miningFunction.getClass().getName() + "." + miningFunction.name()));
    assignExpressionMap.put("pmmlMODEL", new NameExpr(PMML_MODEL.class.getName() + "." + PMML_MODEL.REGRESSION_MODEL.name()));
    ObjectCreationExpr objectCreationExpr = new ObjectCreationExpr();
    objectCreationExpr.setType(nestedTable);
    assignExpressionMap.put("regressionTable", objectCreationExpr);
    assertTrue(commonEvaluateConstructor(constructorDeclaration, generatedClassName, superInvocationExpressionsMap, assignExpressionMap));
}