EnvironmentVariableConfigFilter extends AbstractConfigFilter { @Override public String filter(String key) { return System.getenv(key); }  @Override String filter(String key); @Override void initializeWithConfiguration(Map<String, String> configuration);  }
@Test public void filter() { environmentVariables.set(MY_PASSWORD_KEY, FILTERED); environmentVariables.set(MY_PASSWORD_KEY_2, FILTERED_2); ConfigFilter configFilter = new EnvironmentVariableConfigFilter(); assertEquals(FILTERED, configFilter.filter(MY_PASSWORD_KEY)); assertEquals(FILTERED_2, configFilter.filter(MY_PASSWORD_KEY_2)); }
@Test public void filterUnknownKey() { ConfigFilter configFilter = new EnvironmentVariableConfigFilter(); assertNull(configFilter.filter("unknown")); }