### Question:
DefaultMetaServerProvider implements MetaServerProvider { @Override public String getMetaServerAddress(Env targetEnv) { return metaServerAddress; } DefaultMetaServerProvider(); @Override String getMetaServerAddress(Env targetEnv); @Override int getOrder(); static final int ORDER; }### Answer:
@Test public void testWithNoSystemProperty() throws Exception { Env someEnv = Env.DEV; DefaultMetaServerProvider defaultMetaServerProvider = new DefaultMetaServerProvider(); assertNull(defaultMetaServerProvider.getMetaServerAddress(someEnv)); }
@Test public void testWithSystemProperty() throws Exception { String someMetaAddress = "someMetaAddress"; Env someEnv = Env.DEV; System.setProperty(ConfigConsts.APOLLO_META_KEY, " " + someMetaAddress + " "); DefaultMetaServerProvider defaultMetaServerProvider = new DefaultMetaServerProvider(); assertEquals(someMetaAddress, defaultMetaServerProvider.getMetaServerAddress(someEnv)); }