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


##########
core/src/test/java/kafka/test/junit/ClusterTestExtensions.java:
##########
@@ -123,8 +123,7 @@ private void processClusterTemplate(ExtensionContext 
context, ClusterTemplate an
         if (!annot.value().isEmpty()) {
             generateClusterConfigurations(context, annot.value(), 
generatedClusterConfigs::add);
         } else {
-            // Ensure we have at least one cluster config
-            
generatedClusterConfigs.add(ClusterConfig.defaultClusterBuilder().build());
+            throw new IllegalStateException("Annotation value can't be empty 
string.");

Review Comment:
   Could we check `annot.value().isEmpty()` first? for example:
   ```java
   if (annot.value().isEmpty()) throw exception;
   ```
   With above change, we can simplify the if-else



-- 
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