DbPropertySource extends PropertySource<DbConfigurationParamService> { @Override public Object getProperty(String name) { Constraints.notNull(name, "name must not be null"); Object value = null; if (isDbProperty(name)) { Optional<DbConfigurationParam> param = this.source.findParameter(name); if (param.isPresent()) { value = param.get().getValue(); } LOG.debug("Get DB property value for name '{}': {}", name, value); } else { LOG.trace("Getting non-DB property value 'null' for name '{}'", name); } return value; } DbPropertySource(String name, DbConfigurationParamService paramService, @Nullable String includePatternStr); @Override Object getProperty(String name);  }
@Test public void testGetParam() { assertThat(env.getProperty("sth.source.1"), is("oneDB")); assertThat(env.getProperty("ohf.source.2"), nullValue()); }