@Test public void testPropertyInterpolation() { PropertyLoader loader = mock(PropertyLoader.class); when(loader.lookupOptional("prop")).thenReturn(Optional.of("{first}-second-{third}")); when(loader.lookupOptional("first")).thenReturn(Optional.of("F")); when(loader.lookupOptional("third")).thenReturn(Optional.of("T")); String value = new PropertyInterpolator(loader).lookup("prop"); assertEquals("F-second-T", value); }
@Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); }
PropertyInterpolator extends AbstractPropertyLoader { @Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); } }
PropertyInterpolator extends AbstractPropertyLoader { @Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); } PropertyInterpolator(PropertyLoader delegate); }
PropertyInterpolator extends AbstractPropertyLoader { @Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); } PropertyInterpolator(PropertyLoader delegate); @Override Optional<String> lookupOptional(String name); }
PropertyInterpolator extends AbstractPropertyLoader { @Override public Optional<String> lookupOptional(String name) { return delegate.lookupOptional(name).map(this::replace); } PropertyInterpolator(PropertyLoader delegate); @Override Optional<String> lookupOptional(String name);  }