chia7712 commented on code in PR #19305:
URL: https://github.com/apache/kafka/pull/19305#discussion_r2023051736


##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/junit/ClusterTestExtensions.java:
##########
@@ -194,14 +194,11 @@ private TestTemplateInvocationContext 
invocationContextForClusterType(
         String baseDisplayName,
         ClusterConfig config
     ) {
-        switch (type) {
-            case KRAFT:
-                return new RaftClusterInvocationContext(baseDisplayName, 
config, false);
-            case CO_KRAFT:
-                return new RaftClusterInvocationContext(baseDisplayName, 
config, true);
-            default:
-                throw new IllegalArgumentException("Unsupported @Type value " 
+ type);
-        }
+        return switch (type) {
+            case KRAFT -> new RaftClusterInvocationContext(baseDisplayName, 
config, false);
+            case CO_KRAFT -> new RaftClusterInvocationContext(baseDisplayName, 
config, true);
+            default -> throw new IllegalArgumentException("Unsupported @Type 
value " + type);

Review Comment:
   we don't need this "default" branch, as you have listed all cases 
exhaustively.



##########
test-common/test-common-runtime/src/test/java/org/apache/kafka/common/test/junit/ClusterTestExtensionsTest.java:
##########
@@ -186,9 +186,7 @@ public void testClusterTests() throws ExecutionException, 
InterruptedException {
     public void testClusterTestWithDisksPerBroker() throws ExecutionException, 
InterruptedException {
         try (Admin admin = clusterInstance.admin()) {
             DescribeLogDirsResult result = 
admin.describeLogDirs(clusterInstance.brokerIds());
-            result.allDescriptions().get().forEach((brokerId, 
logDirDescriptionMap) -> {
-                assertEquals(clusterInstance.config().numDisksPerBroker(), 
logDirDescriptionMap.size());
-            });
+            result.allDescriptions().get().forEach((brokerId, 
logDirDescriptionMap) -> 
assertEquals(clusterInstance.config().numDisksPerBroker(), 
logDirDescriptionMap.size()));

Review Comment:
   split it please 



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to