@Test public void testRemoteRegionUrlsWithName1Region() throws Exception { String region1 = "myregion1"; String region1url = "http://local:888/eee"; ConfigurationManager.getConfigInstance().setProperty("eureka.remoteRegionUrlsWithName", region1 + ';' + region1url); DefaultEurekaServerConfig config = new DefaultEurekaServerConfig(); Map<String, String> remoteRegionUrlsWithName = config.getRemoteRegionUrlsWithName(); Assert.assertEquals("Unexpected remote region url count.", 1, remoteRegionUrlsWithName.size()); Assert.assertTrue("Remote region 1 not found.", remoteRegionUrlsWithName.containsKey(region1)); Assert.assertEquals("Unexpected remote region 1 url.", region1url, remoteRegionUrlsWithName.get(region1)); }
@Test public void testRemoteRegionUrlsWithName2Regions() throws Exception { String region1 = "myregion1"; String region1url = "http://local:888/eee"; String region2 = "myregion2"; String region2url = "http://local:888/eee"; ConfigurationManager.getConfigInstance().setProperty("eureka.remoteRegionUrlsWithName", region1 + ';' + region1url + ',' + region2 + ';' + region2url); DefaultEurekaServerConfig config = new DefaultEurekaServerConfig(); Map<String, String> remoteRegionUrlsWithName = config.getRemoteRegionUrlsWithName(); Assert.assertEquals("Unexpected remote region url count.", 2, remoteRegionUrlsWithName.size()); Assert.assertTrue("Remote region 1 not found.", remoteRegionUrlsWithName.containsKey(region1)); Assert.assertTrue("Remote region 2 not found.", remoteRegionUrlsWithName.containsKey(region2)); Assert.assertEquals("Unexpected remote region 1 url.", region1url, remoteRegionUrlsWithName.get(region1)); Assert.assertEquals("Unexpected remote region 2 url.", region2url, remoteRegionUrlsWithName.get(region2)); }