tillrohrmann commented on a change in pull request #9691: [FLINK-13965] Keep 
hasDeprecatedKeys and deprecatedKeys methods in ConfigOption and mark it with 
@Deprecated annotation
URL: https://github.com/apache/flink/pull/9691#discussion_r325500646
 
 

 ##########
 File path: 
flink-core/src/test/java/org/apache/flink/configuration/ConfigOptionTest.java
 ##########
 @@ -86,4 +87,32 @@ public void testDeprecationFlagForMixedAlternativeKeys() {
                assertThat(fallbackKeys, containsInAnyOrder("fallback1", 
"fallback2"));
                assertThat(deprecatedKeys, containsInAnyOrder("deprecated1", 
"deprecated2"));
        }
+
+       @Test
+       public void testDeprecationForDeprecatedKeys() {
+               String[] deprecatedKeys = new String[] { "deprecated1", 
"deprecated2" };
+               final ConfigOption<Integer> optionWithDeprecatedKeys = 
ConfigOptions
+                       .key("key")
+                       .defaultValue(0)
+                       .withDeprecatedKeys(deprecatedKeys)
+                       .withFallbackKeys("fallback1");
+
+               assertTrue(optionWithDeprecatedKeys.hasDeprecatedKeys());
+               int counter = 0;
+               for (final String deprecatedKey : 
optionWithDeprecatedKeys.deprecatedKeys()) {
+                       counter++;
+                       assertTrue(Arrays.stream(deprecatedKeys).anyMatch(item 
-> item.equals(deprecatedKey)));
+               }
 
 Review comment:
   nit: Instead of manually going over the `deprecatedKeys` one could convert 
them and the input keys into a `Set` and use `assertEquals`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to