vongosling commented on a change in pull request #2059:
URL: https://github.com/apache/rocketmq/pull/2059#discussion_r435662168



##########
File path: 
client/src/test/java/org/apache/rocketmq/client/consumer/DefaultLitePullConsumerTest.java
##########
@@ -304,6 +306,30 @@ public void testPauseAndResume_Success() throws Exception {
         }
     }
 
+    @Test
+    public void testPullTaskImpl_ProcessQueueNull() throws Exception {
+        DefaultLitePullConsumer litePullConsumer = 
createNotStartLitePullConsumer();
+        try {
+            MessageQueue messageQueue = createMessageQueue();
+            litePullConsumer.assign(Collections.singletonList(messageQueue));
+            Field field = 
DefaultLitePullConsumer.class.getDeclaredField("defaultLitePullConsumerImpl");
+            field.setAccessible(true);
+            // set ProcessQueue dropped = true
+            DefaultLitePullConsumerImpl localLitePullConsumerImpl = 
(DefaultLitePullConsumerImpl) field.get(litePullConsumer);
+            field = 
DefaultLitePullConsumerImpl.class.getDeclaredField("assignedMessageQueue");
+            field.setAccessible(true);
+            
when(assignedMQ.isPaused(any(MessageQueue.class))).thenReturn(false);
+            
when(assignedMQ.getProcessQueue(any(MessageQueue.class))).thenReturn(null);

Review comment:
       null or dropped case can coexist in one test? null may be the real you 
passed case in this test while dropped case could not be tested, right? IMO, 
your tests are very close to merging, can you think more carefully about the 
coverage of this test case




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to