ConfigService { public static ConfigFile getConfigFile(String namespace, ConfigFileFormat configFileFormat) { return s_instance.getManager().getConfigFile(namespace, configFileFormat); }  static Config getAppConfig(); static Config getConfig(String namespace); static ConfigFile getConfigFile(String namespace, ConfigFileFormat configFileFormat);  }
@Test public void testMockConfigFactoryForConfigFile() throws Exception { String someNamespace = "mock"; ConfigFileFormat someConfigFileFormat = ConfigFileFormat.Properties; String someNamespaceFileName = String.format("%s.%s", someNamespace, someConfigFileFormat.getValue()); MockInjector.setInstance(ConfigFactory.class, someNamespaceFileName, new MockConfigFactory()); ConfigFile configFile = ConfigService.getConfigFile(someNamespace, someConfigFileFormat); assertEquals(someNamespaceFileName, configFile.getNamespace()); assertEquals(someNamespaceFileName + ":" + someConfigFileFormat.getValue(), configFile.getContent()); }