From cccebda24537a55a38a933e172992730fd08de1e Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 14 Sep 2015 12:21:51 +0200 Subject: [PATCH] test: added more logging Original commit: elastic/x-pack-elasticsearch@5bb3c97e492717f34b07deffe1e715270f199364 --- .../watcher/test/integration/WatchMetadataTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java index c3eb42d495f..331a4593586 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatchMetadataTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.watcher.test.integration; import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.test.junit.annotations.TestLogging; import org.joda.time.DateTime; import org.elasticsearch.watcher.actions.logging.LoggingAction; import org.elasticsearch.watcher.actions.logging.LoggingLevel; @@ -78,6 +79,7 @@ public class WatchMetadataTests extends AbstractWatcherIntegrationTestCase { } @Test + @TestLogging("watcher:TRACE") public void testWatchMetadataAvailableAtExecution() throws Exception { Map metadata = new HashMap<>(); metadata.put("foo", "bar"); @@ -98,7 +100,8 @@ public class WatchMetadataTests extends AbstractWatcherIntegrationTestCase { TriggerEvent triggerEvent = new ScheduleTriggerEvent(new DateTime(UTC), new DateTime(UTC)); ExecuteWatchResponse executeWatchResponse = watcherClient().prepareExecuteWatch("_name").setTriggerEvent(triggerEvent).setActionMode("_all", ActionExecutionMode.SIMULATE).get(); - Map result = executeWatchResponse.getRecordSource().getAsMap();; + Map result = executeWatchResponse.getRecordSource().getAsMap(); + logger.info("result=\n{}", result); assertThat(ObjectPath.eval("metadata.foo", result), equalTo("bar")); assertThat(ObjectPath.eval("result.actions.0.id", result), equalTo("testLogger"));