@Test void overwritten() { when(env.getProperty("network")).thenReturn("kovan"); when(env.getProperty("network.public")).thenReturn("true"); final Map<String, Object> envProperties = MapBuilder.<String, Object>builder() .put("network", "kovan") .put("network", "main") .put("network.public", "true") .build(); when(environmentEndpoint.invoke()).thenReturn(envProperties); final Map<String, Object> result = endpoint.invoke(); assertThat(result).isEqualTo(MapBuilder.<String, Object>builder() .put("network", "kovan") .build()); }
@Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); }
PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } }
PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
                                     @Value("${endpoints.pubenv.enabled:false}") final Boolean enabled,
                                     @Value("${endpoints.pubenv.sensitive:true}") final Boolean sensitive,
                                     Environment env); }
PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
                                     @Value("${endpoints.pubenv.enabled:false}") final Boolean enabled,
                                     @Value("${endpoints.pubenv.sensitive:true}") final Boolean sensitive,
                                     Environment env); @Override Map<String, Object> invoke(); }
PublicEnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> { @Override public Map<String, Object> invoke() { return filterOutNonPublicProperties(environmentEndpoint.invoke()); } PublicEnvironmentEndpoint(final EnvironmentEndpoint environmentEndpoint,
                                     @Value("${endpoints.pubenv.enabled:false}") final Boolean enabled,
                                     @Value("${endpoints.pubenv.sensitive:true}") final Boolean sensitive,
                                     Environment env); @Override Map<String, Object> invoke();  }