masteryhx commented on code in PR #23355: URL: https://github.com/apache/flink/pull/23355#discussion_r1318142694
########## flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java: ########## @@ -500,6 +493,7 @@ public void testGetKeysAndNamespaces() throws Exception { keysByNamespace.computeIfAbsent(entry.f1, k -> new HashSet<>()); assertTrue("Duplicate key for namespace", keys.add(entry.f0)); }); + assertThat(keysByNamespace.size(), is(namespaces.length)); Review Comment: What you mentioned is a good way for Junit 5 which tells us not to assert in the for loop for collection. What you added in Junit 4 is not a same way, just as the website said, 'Don’t use Hamcrest'. And it's a deprecated method. ########## flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java: ########## @@ -500,6 +493,7 @@ public void testGetKeysAndNamespaces() throws Exception { keysByNamespace.computeIfAbsent(entry.f1, k -> new HashSet<>()); assertTrue("Duplicate key for namespace", keys.add(entry.f0)); }); + assertThat(keysByNamespace.size(), is(namespaces.length)); Review Comment: What you mentioned is a good way for Junit 5 which tells us not to assert in the for loop for collection. What you added in Junit 4 is not a same way, just as the website said, 'Don’t use Hamcrest'. And it's a deprecated method. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org