JimmyWang6 commented on code in PR #18907:
URL: https://github.com/apache/kafka/pull/18907#discussion_r1957392043


##########
test-common/test-common-internal-api/src/main/java/org/apache/kafka/common/test/api/ClusterTemplate.java:
##########
@@ -30,9 +30,9 @@
 
 /**
  * Used to indicate that a test should call the method given by {@link 
#value()} to generate a number of
- * cluster configurations. The method specified by the value should accept a 
single argument of the type
- * {@link ClusterGenerator}. Any return value from the method is ignored. A 
test invocation
- * will be generated for each {@link ClusterConfig} provided to the 
ClusterGenerator instance.
+ * cluster configurations. The method specified by the value does not accept 
any arguments.

Review Comment:
   Hi @chia7712, If the method is not defined as static, an exception is thrown 
as following:
   `Cannot invoke non-static method [private 
java.util.List<org.apache.kafka.common.test.api.ClusterConfig> 
org.apache.kafka.tools.consumer.group.DeleteConsumerGroupsTest.generator()] on 
a null target.
   org.junit.platform.commons.PreconditionViolationException: Cannot invoke 
non-static method [private 
java.util.List<org.apache.kafka.common.test.api.ClusterConfig> 
org.apache.kafka.tools.consumer.group.DeleteConsumerGroupsTest.generator()] on 
a null target.
        at 
org.apache.kafka.common.test.junit.ClusterTestExtensions.generateClusterConfiguration(ClusterTestExtensions.java:235)
   `
   I haven't thought of a good way to prevent the method that returns 
List<ClusterConfig> from being non-static yet. Any suggestions? I have added 
the sample code.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to