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


##########
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java:
##########
@@ -395,6 +395,24 @@ public void testConstructorClose(GroupProtocol 
groupProtocol) {
         }
     }
 
+    @ParameterizedTest
+    @EnumSource(GroupProtocol.class)
+    public void testConstructorInvalidMetricReporters(GroupProtocol 
groupProtocol) {
+        Properties props = new Properties();
+        props.setProperty(ConsumerConfig.GROUP_PROTOCOL_CONFIG, 
groupProtocol.name());
+        props.setProperty(ConsumerConfig.CLIENT_ID_CONFIG, 
"testConstructorInvalidMetricReporters");
+        props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, 
"localhost:9999");
+        props.setProperty(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, 
"an.invalid.class");
+
+        try {

Review Comment:
   Could you please leverage `assertThrows` ?



##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumerTest.java:
##########
@@ -248,6 +248,18 @@ public void testFailOnClosedConsumer() {
         assertEquals("This consumer has already been closed.", 
res.getMessage());
     }
 
+    @Test
+    public void testFailConstructor() {

Review Comment:
   this is covered by 
`KafkaConsumerTest.testConstructorInvalidMetricReporters`, so could you please 
remove it?



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