DefaultConfigFactory implements ConfigFactory { LocalFileConfigRepository createLocalConfigRepository(String namespace) { if (m_configUtil.isInLocalMode()) { logger.warn( "==== Apollo is in local mode! Won't pull configs from remote server for namespace {} ! ====", namespace); return new LocalFileConfigRepository(namespace); } return new LocalFileConfigRepository(namespace, createRemoteConfigRepository(namespace)); } DefaultConfigFactory(); @Override Config create(String namespace); @Override ConfigFile createConfigFile(String namespace, ConfigFileFormat configFileFormat);  }
@Test public void testCreateLocalConfigRepositoryInLocalDev() throws Exception { String someNamespace = "someName"; someEnv = Env.LOCAL; LocalFileConfigRepository localFileConfigRepository = defaultConfigFactory.createLocalConfigRepository(someNamespace); assertNull(ReflectionTestUtils.getField(localFileConfigRepository, "m_upstream")); }