ijuma commented on a change in pull request #9520: URL: https://github.com/apache/kafka/pull/9520#discussion_r546320434
########## File path: clients/src/test/java/org/apache/kafka/common/metrics/MetricsTest.java ########## @@ -196,12 +197,12 @@ public void testHierarchicalSensors() { assertNull(metrics.childrenSensors().get(grandchild)); } - @Test(expected = IllegalArgumentException.class) + @Test public void testBadSensorHierarchy() { Sensor p = metrics.sensor("parent"); Sensor c1 = metrics.sensor("child1", p); Sensor c2 = metrics.sensor("child2", p); - metrics.sensor("gc", c1, c2); // should fail + assertThrows(IllegalArgumentException.class, () -> metrics.sensor("gc", c1, c2)); // should fail Review comment: We can remove the comment, it's redundant. ########## File path: clients/src/test/java/org/apache/kafka/common/record/ByteBufferLogInputStreamTest.java ########## @@ -116,8 +117,7 @@ public void iteratorRaisesOnTooLargeRecords() { buffer.flip(); ByteBufferLogInputStream logInputStream = new ByteBufferLogInputStream(buffer, 25); - assertNotNull(logInputStream.nextBatch()); - logInputStream.nextBatch(); + assertThrows(CorruptRecordException.class, logInputStream::nextBatch); Review comment: Hmm, I think this was intended to fail on the second `nextBatch`, so maybe we should adjust the test. ########## File path: core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala ########## @@ -411,14 +411,13 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas * Tests that a consumer fails to consume messages without the appropriate * ACL set. */ - @Test(expected = classOf[KafkaException]) + @Test def testNoConsumeWithoutDescribeAclViaAssign(): Unit = { noConsumeWithoutDescribeAclSetup() val consumer = createConsumer() consumer.assign(List(tp).asJava) // the exception is expected when the consumer attempts to lookup offsets - consumeRecords(consumer) - confirmReauthenticationMetrics() Review comment: We should not remove this, right? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org