chia7712 commented on code in PR #22637:
URL: https://github.com/apache/kafka/pull/22637#discussion_r3461853423


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManagerTest.java:
##########
@@ -67,12 +67,14 @@ abstract class AbstractHeartbeatRequestManagerTest {
     protected SubscriptionState subscriptions;
     protected BackgroundEventHandler backgroundEventHandler;
     protected HeartbeatRequestState heartbeatRequestState;
-    protected AbstractMembershipManager membershipManager;
-    protected AbstractHeartbeatRequestManager heartbeatRequestManager;
+    protected AbstractMembershipManager<R> membershipManager;
+    protected AbstractHeartbeatRequestManager<R> heartbeatRequestManager;
 
     protected abstract ClientResponse createHeartbeatResponse(
         NetworkClientDelegate.UnsentRequest request, Errors error);
 
+    protected abstract Class<R> responseClass();

Review Comment:
   What do you think about using a constructor instead?
   
   ```java
       protected final Class<R> responseClass;
   
       protected AbstractHeartbeatRequestManagerTest(Class<R> responseClass) {
           this.responseClass = responseClass;
       }
   ```
   This approach is more robust, since the subclass can't change the type 
arbitrarily



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