use of org.springframework.cloud.context.environment.EnvironmentChangeEvent in project spring-cloud-netflix by spring-cloud.
the class GZIPCompression method zuulHostKeysUpdateHttpClient.
@Test
public void zuulHostKeysUpdateHttpClient() {
setupContext();
SimpleHostRoutingFilter filter = getFilter();
CloseableHttpClient httpClient = (CloseableHttpClient) ReflectionTestUtils.getField(filter, "httpClient");
EnvironmentChangeEvent event = new EnvironmentChangeEvent(Collections.singleton("zuul.host.mykey"));
filter.onPropertyChange(event);
CloseableHttpClient newhttpClient = (CloseableHttpClient) ReflectionTestUtils.getField(filter, "httpClient");
Assertions.assertThat(httpClient).isNotEqualTo(newhttpClient);
}
use of org.springframework.cloud.context.environment.EnvironmentChangeEvent in project logging-log4j2 by apache.
the class Log4j2EventListenerTest method test.
@Test
public void test() throws Exception {
AtomicInteger count = new AtomicInteger(0);
Source source = new Source(new File("test.java"));
loggerContextRule.getLoggerContext().getConfiguration().getWatchManager().watch(source, new TestWatcher(count));
publisher.publishEvent(new EnvironmentChangeEvent(new HashSet<>()));
assertTrue(count.get() > 0);
}
Aggregations