use of org.apache.servicecomb.config.center.client.AddressManager in project incubator-servicecomb-java-chassis by apache.
the class ConfigCenterConfigurationSourceImplTest method onRefreshEndpointEventTest.
@Test
void onRefreshEndpointEventTest() {
List<String> addresses = new ArrayList<>();
addresses.add("http://127.0.0.1:30103");
List<String> addressAZ = new ArrayList<>();
addressAZ.add("rest://127.0.0.1:30100?sslEnabled=true");
Map<String, List<String>> zoneAndRegion = new HashMap<>();
zoneAndRegion.put("sameZone", addressAZ);
zoneAndRegion.put("sameRegion", new ArrayList<>());
RefreshEndpointEvent event = new RefreshEndpointEvent(zoneAndRegion, "CseConfigCenter");
AddressManager addressManager = new AddressManager("test", addresses, EventManager.getEventBus());
addressManager.onRefreshEndpointEvent(event);
List<String> availableAZ = Deencapsulation.getField(addressManager, "availableZone");
Assert.assertEquals("https://127.0.0.1:30100/v3/test", availableAZ.get(0));
}
Aggregations