test: added more logging
Original commit: elastic/x-pack-elasticsearch@5bb3c97e49
This commit is contained in:
parent
4ac8b87f3b
commit
cccebda245
|
@ -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<String, Object> 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<String, Object> result = executeWatchResponse.getRecordSource().getAsMap();;
|
||||
Map<String, Object> result = executeWatchResponse.getRecordSource().getAsMap();
|
||||
logger.info("result=\n{}", result);
|
||||
|
||||
assertThat(ObjectPath.<String>eval("metadata.foo", result), equalTo("bar"));
|
||||
assertThat(ObjectPath.<String>eval("result.actions.0.id", result), equalTo("testLogger"));
|
||||
|
|
Loading…
Reference in New Issue