Only query for watcher history docs with the expected state,

otherwise other history docs can be returned, which may not
have the expected state, and this test only checks the first hit.

Relates to #30777
This commit is contained in:
Martijn van Groningen 2020-01-29 13:51:42 +01:00
parent e0e35b7feb
commit 8c78404814
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 1 additions and 3 deletions

View File

@ -181,9 +181,7 @@ public class SmokeTestWatcherWithSecurityIT extends ESRestTestCase {
}
// check history, after watch has fired
ObjectPath objectPath = getWatchHistoryEntry(watchId);
String state = objectPath.evaluate("hits.hits.0._source.state");
assertThat(state, is("execution_not_needed"));
ObjectPath objectPath = getWatchHistoryEntry(watchId, "execution_not_needed");
boolean conditionMet = objectPath.evaluate("hits.hits.0._source.result.condition.met");
assertThat(conditionMet, is(false));
}