### Question:
DefaultServerManager implements ServerManager { @Override public List<ServerNode> getServerList() { if (inited.compareAndSet(false, true)) { this.syncServerListTask.start(); } if (serverNodes.isEmpty()) { syncServerList(); } return new ArrayList<ServerNode>(serverNodes); } DefaultServerManager(RegistryClientConfig config); @Override List<ServerNode> getServerList(); @Override ServerNode random(); static final int MIN_RETRY_INTERVAL; }### Answer:
@Test public void initServerList() throws Exception { PowerMockito.mockStatic(HttpClientUtils.class); RegistryClientConfig config = mock(RegistryClientConfig.class); when(config.getSyncConfigRetryInterval()).thenReturn(100); when( HttpClientUtils.get(anyString(), anyMapOf(String.class, String.class), any(RegistryClientConfig.class))).thenReturn("127.0.0.1:9600;127.0.0.2:9600"); ServerManager serverManager = new DefaultServerManager(config); List<ServerNode> serverList = serverManager.getServerList(); assertNotNull(serverList); Thread.sleep(450); PowerMockito.verifyStatic(times(4)); }