@Test void should_be_set_when_exist_udsproxy_memcached_port() { environment.getPropertySources() .addLast(new MapPropertySource("test", singletonMap("udsproxy.memcached.port", 11211))); processor.postProcessEnvironment(environment, null); assertThat(environment.getProperty("eureka.instance.metadata-map.udsproxy.memcached.port")).isEqualTo("11211"); }
@Override public void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application) { final Map<String, Object> source = new ConcurrentHashMap<>(); if (!environment.containsProperty("eureka.instance.asg-name")) { final String asgName = environment.getProperty("evcache.asg-name", "DEFAULT"); source.put("eureka.instance.asg-name", asgName); LOGGER.warn("`eureka.instance.asg-name` is Missing, set `{}`", asgName); } putMetadataIfAbsent(source, environment, "evcache.port"); putMetadataIfAbsent(source, environment, "evcache.secure.port"); putMetadataIfAbsent(source, environment, "rend.port"); putMetadataIfAbsent(source, environment, "rend.batch.port"); putMetadataIfAbsent(source, environment, "udsproxy.memcached.port"); putMetadataIfAbsent(source, environment, "udsproxy.memento.port"); environment.getPropertySources() .addLast(new MapPropertySource("evcache-server", source)); }
EVCacheServerEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application) { final Map<String, Object> source = new ConcurrentHashMap<>(); if (!environment.containsProperty("eureka.instance.asg-name")) { final String asgName = environment.getProperty("evcache.asg-name", "DEFAULT"); source.put("eureka.instance.asg-name", asgName); LOGGER.warn("`eureka.instance.asg-name` is Missing, set `{}`", asgName); } putMetadataIfAbsent(source, environment, "evcache.port"); putMetadataIfAbsent(source, environment, "evcache.secure.port"); putMetadataIfAbsent(source, environment, "rend.port"); putMetadataIfAbsent(source, environment, "rend.batch.port"); putMetadataIfAbsent(source, environment, "udsproxy.memcached.port"); putMetadataIfAbsent(source, environment, "udsproxy.memento.port"); environment.getPropertySources() .addLast(new MapPropertySource("evcache-server", source)); } }
EVCacheServerEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application) { final Map<String, Object> source = new ConcurrentHashMap<>(); if (!environment.containsProperty("eureka.instance.asg-name")) { final String asgName = environment.getProperty("evcache.asg-name", "DEFAULT"); source.put("eureka.instance.asg-name", asgName); LOGGER.warn("`eureka.instance.asg-name` is Missing, set `{}`", asgName); } putMetadataIfAbsent(source, environment, "evcache.port"); putMetadataIfAbsent(source, environment, "evcache.secure.port"); putMetadataIfAbsent(source, environment, "rend.port"); putMetadataIfAbsent(source, environment, "rend.batch.port"); putMetadataIfAbsent(source, environment, "udsproxy.memcached.port"); putMetadataIfAbsent(source, environment, "udsproxy.memento.port"); environment.getPropertySources() .addLast(new MapPropertySource("evcache-server", source)); }  }
EVCacheServerEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application) { final Map<String, Object> source = new ConcurrentHashMap<>(); if (!environment.containsProperty("eureka.instance.asg-name")) { final String asgName = environment.getProperty("evcache.asg-name", "DEFAULT"); source.put("eureka.instance.asg-name", asgName); LOGGER.warn("`eureka.instance.asg-name` is Missing, set `{}`", asgName); } putMetadataIfAbsent(source, environment, "evcache.port"); putMetadataIfAbsent(source, environment, "evcache.secure.port"); putMetadataIfAbsent(source, environment, "rend.port"); putMetadataIfAbsent(source, environment, "rend.batch.port"); putMetadataIfAbsent(source, environment, "udsproxy.memcached.port"); putMetadataIfAbsent(source, environment, "udsproxy.memento.port"); environment.getPropertySources() .addLast(new MapPropertySource("evcache-server", source)); }  @Override void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application); @Override int getOrder(); }
EVCacheServerEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application) { final Map<String, Object> source = new ConcurrentHashMap<>(); if (!environment.containsProperty("eureka.instance.asg-name")) { final String asgName = environment.getProperty("evcache.asg-name", "DEFAULT"); source.put("eureka.instance.asg-name", asgName); LOGGER.warn("`eureka.instance.asg-name` is Missing, set `{}`", asgName); } putMetadataIfAbsent(source, environment, "evcache.port"); putMetadataIfAbsent(source, environment, "evcache.secure.port"); putMetadataIfAbsent(source, environment, "rend.port"); putMetadataIfAbsent(source, environment, "rend.batch.port"); putMetadataIfAbsent(source, environment, "udsproxy.memcached.port"); putMetadataIfAbsent(source, environment, "udsproxy.memento.port"); environment.getPropertySources() .addLast(new MapPropertySource("evcache-server", source)); }  @Override void postProcessEnvironment(final ConfigurableEnvironment environment, final SpringApplication application); @Override int getOrder();  }