panzhi33 commented on a change in pull request #3746:
URL: https://github.com/apache/rocketmq/pull/3746#discussion_r812599861



##########
File path: 
client/src/test/java/org/apache/rocketmq/client/impl/MQClientAPIImplTest.java
##########
@@ -476,4 +477,21 @@ public Object answer(InvocationOnMock invocationOnMock) 
throws Throwable {
         int topicCnt = mqClientAPI.addWritePermOfBroker("127.0.0.1", 
"default-broker", 1000);
         assertThat(topicCnt).isEqualTo(7);
     }
+
+    @Test
+    public void testGetMasterSlaveDiff() throws Exception {
+        final long diff = 123L;
+        doAnswer(new Answer() {
+            @Override
+            public Object answer(InvocationOnMock invocationOnMock) throws 
Throwable {
+                final RemotingCommand response = 
RemotingCommand.createResponseCommand(RequestCode.GET_MASTER_SLAVE_DIFF, null);
+                
response.setBody(String.valueOf(diff).getBytes(MixAll.DEFAULT_CHARSET));
+                response.setCode(ResponseCode.SUCCESS);
+                return response;
+            }
+        }).when(remotingClient).invokeSync(anyString(), 
any(RemotingCommand.class), anyLong());
+
+        long ret = mqClientAPI.getMasterSlaveDiff("127.0.0.1:10911", 1000);
+        assertThat(ret).isEqualTo(diff);
+    }
 }

Review comment:
       This unit test has nothing to do with this pr, you can mention a pr again




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