public QueryResult queryMessage(String topic, String key, int maxNum, long begin,
        long end) throws MQClientException,
        InterruptedException {
        return queryMessage(topic, key, maxNum, begin, end, false);
    }
@Test
    public void assertQueryMessage() throws InterruptedException, MQClientException, MQBrokerException, RemotingException {
        doAnswer(invocation -> {
            InvokeCallback callback = invocation.getArgument(3);
            QueryMessageResponseHeader responseHeader = new QueryMessageResponseHeader();
            responseHeader.setIndexLastUpdatePhyoffset(1L);
            responseHeader.setIndexLastUpdateTimestamp(System.currentTimeMillis());
            RemotingCommand response = mock(RemotingCommand.class);
            when(response.decodeCommandCustomHeader(QueryMessageResponseHeader.class)).thenReturn(responseHeader);
            when(response.getBody()).thenReturn(getMessageResult());
            when(response.getCode()).thenReturn(ResponseCode.SUCCESS);
            callback.operationSucceed(response);
            return null;
        }).when(mQClientAPIImpl).queryMessage(anyString(), any(), anyLong(), any(InvokeCallback.class), any());
        QueryResult actual = mqAdminImpl.queryMessage(defaultTopic, "keys", 100, 1L, 50L, false);
        assertNotNull(actual);
        assertEquals(1, actual.getMessageList().size());
        assertEquals(defaultTopic, actual.getMessageList().get(0).getTopic());
    }