### Question:
DefaultConfigurationAdmin implements ConfigurationAdmin { @Override public Configuration getConfiguration(final String pid, final String location) { return getOrCreate(null, pid, location, null); } DefaultConfigurationAdmin(final Map<String, String> providedConfiguration,
            final Collection<ConfigurationListener> configurationListeners); Map<String, String> getProvidedConfiguration(); @Override Configuration getFactoryConfiguration(final String factoryPid, final String name, final String location); @Override Configuration getFactoryConfiguration(final String factoryPid, final String name); @Override Configuration createFactoryConfiguration(final String pid); @Override Configuration createFactoryConfiguration(final String pid, final String location); @Override Configuration getConfiguration(final String pid, final String location); @Override Configuration getConfiguration(final String pid); @Override Configuration[] listConfigurations(final String filter);  }### Answer:
@Test @DisplayName("Should return value from system property") void systemPropertiesTest() { System.setProperty("winegrower.service.test.foo", "bar"); Configuration configuration = configurationAdmin.getConfiguration("test"); Assertions.assertEquals("bar", configuration.getProperties().get("foo")); }
@Test @DisplayName("Should return value from cfg file in classpath") void externalConfigClasspathTest() { Configuration configuration = configurationAdmin.getConfiguration("external.test"); Assertions.assertEquals("bar", configuration.getProperties().get("foo")); }
@Test @DisplayName("Should return value from cfg file in winegrower.config.path location") void externalConfigPathTest() { File file = new File("src/test/resources"); System.out.println(file.getAbsolutePath()); System.setProperty("winegrower.config.path", "src/test/resources"); Configuration configuration = configurationAdmin.getConfiguration("external.test"); Assertions.assertEquals("bar", configuration.getProperties().get("foo")); }