public static DATA_TYPE getTargetFieldType(final List<Field<?>> fields, final Model model) {
        return getTargetFieldsTypeMap(fields, model).entrySet().iterator().next().getValue();
    }
@Test
    void getTargetFieldTypeWithoutTargetField() {
        assertThatExceptionOfType(Exception.class).isThrownBy(() -> {
            final String fieldName = "fieldName";
            MiningField.UsageType usageType = MiningField.UsageType.ACTIVE;
            MiningField miningField = getMiningField(fieldName, usageType);
            final DataField dataField = getDataField(fieldName, OpType.CATEGORICAL, DataType.STRING);
            final DataDictionary dataDictionary = new DataDictionary();
            dataDictionary.addDataFields(dataField);
            final MiningSchema miningSchema = new MiningSchema();
            miningSchema.addMiningFields(miningField);
            final Model model = new RegressionModel();
            model.setMiningSchema(miningSchema);
            org.kie.pmml.compiler.api.utils.ModelUtils.getTargetFieldType(getFieldsFromDataDictionary(dataDictionary)
                    , model);
        });
    }