@Override
    public boolean createTopicOnTopicBrokerIfNotExist(String createTopic, String sampleTopic, int wQueueNum,
        int rQueueNum, boolean examineTopic, int retryCheckCount) {
        TopicRouteData curTopicRouteData = new TopicRouteData();
        try {
            curTopicRouteData = this.getTopicRouteDataDirectlyFromNameServer(createTopic);
        } catch (Exception e) {
            if (!TopicRouteHelper.isTopicNotExistError(e)) {
                log.error("get cur topic route {} failed.", createTopic, e);
                return false;
            }
        }

        TopicRouteData sampleTopicRouteData = null;
        try {
            sampleTopicRouteData = this.getTopicRouteDataDirectlyFromNameServer(sampleTopic);
        } catch (Exception e) {
            log.error("create topic {} failed.", createTopic, e);
            return false;
        }

        if (sampleTopicRouteData == null || sampleTopicRouteData.getBrokerDatas().isEmpty()) {
            return false;
        }

        try {
            return this.createTopicOnBroker(createTopic, wQueueNum, rQueueNum, curTopicRouteData.getBrokerDatas(),
                sampleTopicRouteData.getBrokerDatas(), examineTopic, retryCheckCount);
        } catch (Exception e) {
            log.error("create topic {} failed.", createTopic, e);
        }
        return false;
    }
@Test
    public void testCreateTopic() throws Exception {
        when(mqClientAPIExt.getTopicRouteInfoFromNameServer(eq("createTopic"), anyLong()))
            .thenThrow(new MQClientException(ResponseCode.TOPIC_NOT_EXIST, ""))
            .thenReturn(createTopicRouteData(1));
        when(mqClientAPIExt.getTopicRouteInfoFromNameServer(eq("sampleTopic"), anyLong()))
            .thenReturn(createTopicRouteData(2));

        ArgumentCaptor<String> addrArgumentCaptor = ArgumentCaptor.forClass(String.class);
        ArgumentCaptor<TopicConfig> topicConfigArgumentCaptor = ArgumentCaptor.forClass(TopicConfig.class);
        doNothing().when(mqClientAPIExt).createTopic(addrArgumentCaptor.capture(), anyString(), topicConfigArgumentCaptor.capture(), anyLong());

        assertTrue(defaultAdminService.createTopicOnTopicBrokerIfNotExist(
            "createTopic",
            "sampleTopic",
            7,
            8,
            true,
            1
        ));

        assertEquals(2, addrArgumentCaptor.getAllValues().size());
        Set<String> createAddr = new HashSet<>(addrArgumentCaptor.getAllValues());
        assertTrue(createAddr.contains("127.0.0.1:10911"));
        assertTrue(createAddr.contains("127.0.0.2:10911"));
        assertEquals("createTopic", topicConfigArgumentCaptor.getValue().getTopicName());
        assertEquals(7, topicConfigArgumentCaptor.getValue().getWriteQueueNums());
        assertEquals(8, topicConfigArgumentCaptor.getValue().getReadQueueNums());
    }