FrankYang0529 commented on code in PR #19975:
URL: https://github.com/apache/kafka/pull/19975#discussion_r2151426572


##########
clients/src/test/java/org/apache/kafka/common/metrics/MetricsTest.java:
##########
@@ -700,24 +681,15 @@ public void testMetricInstances() {
             assertEquals(filledOutTags.get("parent-tag"), "parent-tag-value", 
"parent-tag should be set properly");
             assertEquals(filledOutTags.get("child-tag"), "child-tag-value", 
"child-tag should be set properly");
 
-            try {
-                
inherited.metricInstance(SampleMetrics.METRIC_WITH_INHERITED_TAGS, 
parentTagsWithValues);
-                fail("Creating MetricName should fail if the child metrics are 
not defined at runtime");
-            } catch (IllegalArgumentException e) {
-                // this is expected
-            }
+            // Creating MetricName should throw IllegalArgumentException if 
the child metrics are not defined at runtime.

Review Comment:
   How about put this message to the third argument in `assertThrows`?



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