private void updateControllerAddr() {
        if (brokerConfig.isFetchControllerAddrByDnsLookup()) {
            List<String> adders = brokerOuterAPI.dnsLookupAddressByDomain(this.brokerConfig.getControllerAddr());
            if (CollectionUtils.isNotEmpty(adders)) {
                this.controllerAddresses = adders;
            }
        } else {
            final String controllerPaths = this.brokerConfig.getControllerAddr();
            final String[] controllers = controllerPaths.split(";");
            assert controllers.length > 0;
            this.controllerAddresses = Arrays.asList(controllers);
        }
    }
@Test
    public void testUpdateControllerAddr() throws Exception {
        final String controllerAddr = "192.168.1.1";
        brokerConfig.setFetchControllerAddrByDnsLookup(true);
        when(brokerOuterAPI.dnsLookupAddressByDomain(anyString())).thenReturn(Lists.newArrayList(controllerAddr));
        Method method = ReplicasManager.class.getDeclaredMethod("updateControllerAddr");
        method.setAccessible(true);
        method.invoke(replicasManager);

        List<String> addresses = replicasManager.getControllerAddresses();
        Assertions.assertThat(addresses).contains(controllerAddr);

        // Simulating dns resolution exceptions
        when(brokerOuterAPI.dnsLookupAddressByDomain(anyString())).thenReturn(new ArrayList<>());

        method.invoke(replicasManager);
        addresses = replicasManager.getControllerAddresses();
        Assertions.assertThat(addresses).contains(controllerAddr);

    }