### Question:
ConfigAdapter extends AbstractConfiguration { @Deprecated @Override public Object getProperty( String key ) { return config.getValue( key ).orElse( null ); } @Deprecated  ConfigAdapter( Config config ); @Deprecated @Override boolean isEmpty(); @Deprecated @Override boolean containsKey( String key ); @Deprecated @Override Object getProperty( String key ); @Deprecated @Override Iterator<String> getKeys();  }### Answer:
@Test public void shouldGetDefaultPropertyByKey() throws Exception { Config config = Config.defaults(); ConfigAdapter wrappingConfiguration = new ConfigAdapter( config ); final Object propertyValue = wrappingConfiguration.getProperty( ServerSettings.rest_api_path.name() ); assertEquals( new URI( ServerSettings.rest_api_path.getDefaultValue() ), propertyValue ); }
@Test public void shouldGetPropertyInRightFormat() throws Exception { Config config = Config.defaults(); ConfigAdapter wrappingConfiguration = new ConfigAdapter( config ); wrappingConfiguration .setProperty( ServerSettings.rest_api_path.name(), "http: final Object dataPath = wrappingConfiguration.getProperty( ServerSettings.rest_api_path.name() ); assertEquals( new URI( ServerSettings.rest_api_path.getDefaultValue() ), dataPath ); }
@Test public void shouldAbleToAccessRegisteredPropertyByName() { Config config = Config.defaults(); ConfigAdapter wrappingConfiguration = new ConfigAdapter( config ); assertEquals( Duration.ofSeconds( 60 ), wrappingConfiguration.getProperty( ServerSettings.transaction_idle_timeout.name() ) ); }
@Test public void shouldAbleToAccessNonRegisteredPropertyByName() { Config config = Config.defaults( ServerSettings.transaction_idle_timeout, "600ms" ); ConfigAdapter wrappingConfiguration = new ConfigAdapter( config ); assertEquals( Duration.ofMillis( 600 ), wrappingConfiguration.getProperty( ServerSettings.transaction_idle_timeout.name() ) ); }