PortalMetaDomainService { public String getDomain(Env env) { String metaServerAddress = getMetaServerAddress(env); if (metaServerAddress.contains(",")) { return selectMetaServerAddress(metaServerAddress); } return metaServerAddress; } PortalMetaDomainService(final PortalConfig portalConfig); String getDomain(Env env); String getMetaServerAddress(Env env); void reload();  }
@Test public void testGetMetaDomain() { String localMetaServerAddress = "http: mockMetaServerAddress(Env.LOCAL, localMetaServerAddress); assertEquals(localMetaServerAddress, portalMetaDomainService.getDomain(Env.LOCAL)); String randomEnvironment = "randomEnvironment"; Env.addEnvironment(randomEnvironment); assertEquals(PortalMetaDomainService.DEFAULT_META_URL, portalMetaDomainService.getDomain(Env.valueOf(randomEnvironment))); }