@Test
    public void testGetConfigByConfigProperty() {
        Properties props = new Properties();

        String stringPropKey = "string_prop";
        String stringPropDefaultValue = "default_string_value";
        String stringPropExpectedValue = "sample_value";

        ConfigProperty<String> stringProp =
                ConfigProperty.key(stringPropKey)
                        .defaultValue(stringPropDefaultValue);

        testGetValueByConfig(
                props,
                stringProp,
                stringPropKey,
                stringPropDefaultValue,
                stringPropExpectedValue);

        String intPropKey = "int_prop";
        int intPropDefaultValue = 1;
        int intPropExpectedValue = 3;
        ConfigProperty<Integer> intProp =
                ConfigProperty.key(intPropKey)
                        .defaultValue(intPropDefaultValue);
        testGetValueByConfig(props, intProp, intPropKey, intPropDefaultValue, intPropExpectedValue);

        String longPropKey = "long_prop";
        long longPropDefaultValue = 1L;
        long longPropExpectedValue = 1000L;
        ConfigProperty<Long> longProp =
                ConfigProperty.key(longPropKey)
                        .defaultValue(longPropDefaultValue);
        testGetValueByConfig(props, longProp, longPropKey, longPropDefaultValue, longPropExpectedValue);

        String floatPropKey = "float_prop";
        float floatPropDefaultValue = 3.14f;
        ConfigProperty<Float> floatProp =
                ConfigProperty.key(floatPropKey)
                        .defaultValue(floatPropDefaultValue);
        float floatExpectedValue = 1000.0f;
        testGetValueByConfig(props, floatProp, floatPropKey, floatPropDefaultValue, floatExpectedValue);

        String doublePropKey = "double_prop";
        double doublePropDefaultValue = 3.14159265358979;
        double doublePropExpectedValue = 1000.1000;
        ConfigProperty<Double> doubleProp =
                ConfigProperty.key(doublePropKey)
                        .defaultValue(doublePropDefaultValue);
        testGetValueByConfig(props, doubleProp, doublePropKey, doublePropDefaultValue, doublePropExpectedValue);
    }
The UnitTest for {@link HudiMetricsConfig#getConfig(Properties, ConfigOption)}
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/hudi/src/test/java/org/apache/inlong/sort/hudi/metric/HudiMetricsConfigTest.java