public TopicList getTopicListFromNameServer(final long timeoutMillis)
        throws RemotingException, MQClientException, InterruptedException {
        RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_ALL_TOPIC_LIST_FROM_NAMESERVER, null);
        RemotingCommand response = this.remotingClient.invokeSync(null, request, timeoutMillis);
        assert response != null;
        switch (response.getCode()) {
            case ResponseCode.SUCCESS: {
                byte[] body = response.getBody();
                if (body != null) {
                    return TopicList.decode(body, TopicList.class);
                }
            }
            default:
                break;
        }

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