brandboat commented on code in PR #20765:
URL: https://github.com/apache/kafka/pull/20765#discussion_r2465905322


##########
core/src/test/java/kafka/server/share/DelayedShareFetchTest.java:
##########
@@ -256,21 +252,26 @@ public void 
testTryCompleteWhenMinBytesNotSatisfiedOnFirstFetch() {
         when(sp0.maybeAcquireFetchLock(fetchId)).thenReturn(true);
         when(sp1.maybeAcquireFetchLock(fetchId)).thenReturn(true);
 
-        assertFalse(delayedShareFetch.isCompleted());
+        try (MockedStatic<ShareFetchUtils> mockedShareFetchUtils = 
Mockito.mockStatic(ShareFetchUtils.class, Mockito.CALLS_REAL_METHODS)) {
+            mockedShareFetchUtils.when(() -> 
ShareFetchUtils.processFetchResponse(any(), any(), any(), any(), any()))

Review Comment:
   I agree with you, remove
   ```
   when(sp0.acquire(any(), anyInt(), anyInt(), anyLong(), any(), 
any())).thenReturn(
               createShareAcquiredRecords(new 
ShareFetchResponseData.AcquiredRecords().setFirstOffset(0).setLastOffset(3).setDeliveryCount((short)
 1)));
   ```
   in L215~215 should be enough.



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