public TopicList queryTopicsByConsumer(final String addr, final String group, final long timeoutMillis)
        throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException, InterruptedException,
        MQBrokerException {
        QueryTopicsByConsumerRequestHeader requestHeader = new QueryTopicsByConsumerRequestHeader();
        requestHeader.setGroup(group);

        RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.QUERY_TOPICS_BY_CONSUMER, requestHeader);
        RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr),
            request, timeoutMillis);
        switch (response.getCode()) {
            case ResponseCode.SUCCESS: {
                TopicList topicList = TopicList.decode(response.getBody(), TopicList.class);
                return topicList;
            }
            default:
                break;
        }

        throw new MQBrokerException(response.getCode(), response.getRemark());
    }
@Test
    public void assertQueryTopicsByConsumer() throws RemotingException, InterruptedException, MQBrokerException {
        mockInvokeSync();
        TopicList responseBody = new TopicList();
        responseBody.getTopicList().add(defaultTopic);
        responseBody.setBrokerAddr(defaultBrokerAddr);
        setResponseBody(responseBody);
        TopicList actual = mqClientAPI.queryTopicsByConsumer(defaultBrokerAddr, "", defaultTimeout);
        assertNotNull(actual);
        assertEquals(1, actual.getTopicList().size());
        assertEquals(defaultBrokerAddr, actual.getBrokerAddr());
    }