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

   The invalid cursor cases in `DescribeTopicPartitionsRequestHandlerTest` 
asserted the exception type only inside `catch` blocks, so they passed when no 
exception was thrown. Other `try`/`catch` blocks around `buildRequest` also 
obscured the original failure stack trace.
   
   This change:
   
   - replaces the catch-only checks with 
`assertThrows(InvalidRequestException.class, ...)`;
   - removes redundant `try`/`catch` blocks around `buildRequest` and lets 
JUnit report failures directly.
   
   Testing:
   
   - JDK 17.0.18: `:core:test --tests 
kafka.server.handlers.DescribeTopicPartitionsRequestHandlerTest`, 
`:core:checkstyleTest`, and `:core:spotlessCheck`;
   - JDK 25.0.5: the same targeted test and checks.
   
   Both test methods pass on both JDK versions used by the Kafka PR test 
matrix. `:core:spotbugsTest` was also requested and was skipped by the existing 
build configuration; the associated `:core:spotbugsMain` task completed 
successfully.
   
   This contribution is my original work, and I license it to the project under 
the Apache License 2.0.


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