diff --git a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java index 38bd96bb04438..1e9731cd1ff4e 100644 --- a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java +++ b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java @@ -51,6 +51,7 @@ /** * Tests for the {@link ConfigOptionsDocGenerator}. */ +@SuppressWarnings("unused") public class ConfigOptionsDocGeneratorTest { @ClassRule @@ -59,11 +60,13 @@ public class ConfigOptionsDocGeneratorTest { static class TestConfigGroup { public static ConfigOption firstOption = ConfigOptions .key("first.option.a") + .intType() .defaultValue(2) .withDescription("This is example description for the first option."); public static ConfigOption secondOption = ConfigOptions .key("second.option.a") + .stringType() .noDefaultValue() .withDescription("This is long example description for the second option."); } @@ -71,7 +74,7 @@ static class TestConfigGroup { private enum TestEnum { VALUE_1, VALUE_2, - VALUE_3; + VALUE_3 } static class TypeTestConfigGroup { @@ -209,34 +212,40 @@ static class TestConfigPrefix { // should end up in the default group public static ConfigOption option1 = ConfigOptions .key("a.option") + .intType() .defaultValue(2); // should end up in group1, perfect key-prefix match public static ConfigOption option2 = ConfigOptions .key("a.b.option") + .stringType() .noDefaultValue(); // should end up in group1, full key-prefix match public static ConfigOption option3 = ConfigOptions .key("a.b.c.option") + .intType() .defaultValue(2); // should end up in group1, full key-prefix match for group 1, partial match for group 2 // checks that the generator remembers the last encountered root node public static ConfigOption option4 = ConfigOptions .key("a.b.c.e.option") + .intType() .defaultValue(2); // should end up in the default group, since no group exists with prefix "a.c" // checks that the generator does not ignore components (like ignoring "c" to find a match "a.b") public static ConfigOption option5 = ConfigOptions .key("a.c.b.option") + .stringType() .noDefaultValue(); // should end up in group2, full key-prefix match for group 2 // checks that the longest matching group is assigned public static ConfigOption option6 = ConfigOptions .key("a.b.c.d.option") + .intType() .defaultValue(2); } @@ -266,21 +275,25 @@ public void testLongestPrefixMatching() { static class TestConfigMultipleSubGroup { public static ConfigOption firstOption = ConfigOptions .key("first.option.a") + .intType() .defaultValue(2) .withDescription("This is example description for the first option."); public static ConfigOption secondOption = ConfigOptions .key("second.option.a") + .stringType() .noDefaultValue() .withDescription("This is long example description for the second option."); public static ConfigOption thirdOption = ConfigOptions .key("third.option.a") + .intType() .defaultValue(2) .withDescription("This is example description for the third option."); public static ConfigOption fourthOption = ConfigOptions .key("fourth.option.a") + .stringType() .noDefaultValue() .withDescription("This is long example description for the fourth option."); } @@ -365,12 +378,14 @@ static class TestConfigGroupWithOverriddenDefault { @Documentation.OverrideDefault("default_1") public static ConfigOption firstOption = ConfigOptions .key("first.option.a") + .intType() .defaultValue(2) .withDescription("This is example description for the first option."); @Documentation.OverrideDefault("default_2") public static ConfigOption secondOption = ConfigOptions .key("second.option.a") + .stringType() .noDefaultValue() .withDescription("This is long example description for the second option."); } @@ -453,12 +468,14 @@ public void testCommonOptions() throws IOException, ClassNotFoundException { static class TestConfigGroupWithExclusion { public static ConfigOption firstOption = ConfigOptions .key("first.option.a") + .intType() .defaultValue(2) .withDescription("This is example description for the first option."); @Documentation.ExcludeFromDocumentation public static ConfigOption excludedOption = ConfigOptions .key("excluded.option.a") + .stringType() .noDefaultValue() .withDescription("This should not be documented."); } diff --git a/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java b/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java index 865d9ecf4c139..200b84d809a3e 100644 --- a/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java +++ b/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java @@ -25,16 +25,19 @@ /** * Collection of test {@link ConfigOptions ConfigOptions}. */ +@SuppressWarnings("unused") // this class is only accessed reflectively public class TestCommonOptions { @Documentation.SectionOption(sections = {Documentation.SectionOption.SECTION_COMMON}) public static final ConfigOption COMMON_OPTION = ConfigOptions .key("first.option.a") + .intType() .defaultValue(2) .withDescription("This is the description for the common option."); public static final ConfigOption GENERIC_OPTION = ConfigOptions .key("second.option.a") + .stringType() .noDefaultValue() .withDescription("This is the description for the generic option."); @@ -43,6 +46,7 @@ public class TestCommonOptions { position = 2) public static final ConfigOption COMMON_POSITIONED_OPTION = ConfigOptions .key("third.option.a") + .intType() .defaultValue(3) .withDescription("This is the description for the positioned common option."); }