Add logging to test

This commit is contained in:
Spencer Gibb
2017-11-21 19:33:41 -05:00
parent 2619a0d68c
commit 08f820440e

View File

@@ -22,6 +22,8 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.RetryOneTime;
@@ -52,6 +54,8 @@ import static org.junit.Assert.assertThat;
*/
public class ZookeeperPropertySourceLocatorTests {
private static final Log log = LogFactory.getLog(ZookeeperPropertySourceLocatorTests.class);
public static final String PREFIX = "test__config__";
public static final String ROOT = "/" + PREFIX + UUID.randomUUID();
public static final String CONTEXT = ROOT + "/application/";
@@ -95,6 +99,7 @@ public class ZookeeperPropertySourceLocatorTests {
@EventListener
public void handle(EnvironmentChangeEvent event) {
log.debug("Event keys: " + event.getKeys());
if (event.getKeys().contains(KEY_BASIC)) {
countDownLatch().countDown();
}
@@ -131,7 +136,7 @@ public class ZookeeperPropertySourceLocatorTests {
this.context = new SpringApplicationBuilder(Config.class).web(false).run(
"--spring.cloud.zookeeper.connectString=" + connectString,
"--spring.application.name=testZkPropertySource",
"--spring.application.name=testZkPropertySource", "--logging.level.org.springframework.cloud.zookeeper=DEBUG",
"--spring.cloud.zookeeper.config.root=" + ROOT);
this.curator = this.context.getBean(CuratorFramework.class);