Skip to content

Commit

Permalink
Only query for watcher history docs with the expected state,
Browse files Browse the repository at this point in the history
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
  • Loading branch information
martijnvg committed Jan 29, 2020
1 parent e0e35b7 commit 8c78404
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ public void testSearchInputWithInsufficientPrivileges() throws Exception {
}

// 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));
}
Expand Down

0 comments on commit 8c78404

Please sign in to comment.