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

   ## Summary                                                                   
                                                                                
                                                                    
                                                                                
                                                                                
                                                                      
   Fix the `unchecked` compile warning in 
`AbstractHeartbeatRequestManagerTest`: `AbstractHeartbeatRequestManager` field 
is raw for the same reason.
   ```
   > Task :clients:compileTestJava
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   Note: 
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManagerTest.java
 uses unchecked or unsafe operations.
   Note: Recompile with -Xlint:unchecked for details.
   ```
   
   Changes:
   - Parameterize `AbstractHeartbeatRequestManagerTest` with `<R extends 
AbstractResponse>` so `membershipManager` and `heartbeatRequestManager` are 
strongly typed instead of raw.
   - Change `assertHeartbeatErrorHandling` to take a typed `R response`.
   - Add an abstract `responseClass()` so the parameterized test can obtain a 
typed response via `Class.cast()`, removing the unchecked call to 
`onHeartbeatSuccess` without needing `@SuppressWarnings`.
   - Update `ConsumerHeartbeatRequestManagerTest` and 
`ShareHeartbeatRequestManagerTest` to extend the base with their concrete 
heartbeat response types (`ConsumerGroupHeartbeatResponse` and 
`ShareGroupHeartbeatResponse`).
   
   ## Testing
   
   - `./gradlew clients:compileTestJava --rerun-tasks` → BUILD SUCCESSFUL, no 
`unchecked` note for `AbstractHeartbeatRequestManagerTest`.
   - `./gradlew clients:test --tests "*ConsumerHeartbeatRequestManagerTest*" 
--tests "*ShareHeartbeatRequestManagerTest*"` → all tests pass.


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