hjtiun852 opened a new pull request, #23277:
URL: https://github.com/apache/kafka/pull/23277

   Modernize six exception assertions in ProducerRecordTest, RecordSendTest and 
MockProducerTest from the old try/call/fail/catch idiom to assertThrows.
   
   assertThrows fails automatically when no exception is thrown, so a missing 
fail() can no longer let a test pass silently, and it pins the exact expected 
type. Where the original catch block asserted on the wrapped cause, the 
assertThrows return value preserves that check:
   
       ExecutionException err = assertThrows(ExecutionException.class, 
md2::get);
       assertEquals(e, err.getCause());
   
   Follows the same cleanup as #19975.
   
   Testing: ./gradlew :clients:test for the three test classes plus checkstyle, 
all green.


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