Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watcher: Fix integration tests to ensure correct start/stop of Watcher #35271

Merged
merged 5 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void startWatcher() throws Exception {
getAdminExecutionContext().callApi("xpack.watcher.start", emptyMap(), emptyList(), emptyMap());
boolean isAcknowledged = (boolean) startResponse.evaluate("acknowledged");
assertThat(isAcknowledged, is(true));
break;
throw new AssertionError("waiting until stopped state reached started state");
case "stopping":
throw new AssertionError("waiting until stopping state reached stopped state to start again");
case "starting":
Expand Down Expand Up @@ -104,7 +104,7 @@ public void stopWatcher() throws Exception {
getAdminExecutionContext().callApi("xpack.watcher.stop", emptyMap(), emptyList(), emptyMap());
boolean isAcknowledged = (boolean) stopResponse.evaluate("acknowledged");
assertThat(isAcknowledged, is(true));
break;
throw new AssertionError("waiting until started state reached stopped state");
default:
throw new AssertionError("unknown state[" + state + "]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void startWatcher() throws Exception {
Response startResponse = adminClient().performRequest(new Request("POST", "/_xpack/watcher/_start"));
Map<String, Object> responseMap = entityAsMap(startResponse);
assertThat(responseMap, hasEntry("acknowledged", true));
break;
throw new AssertionError("waiting until stopped state reached started state");
case "stopping":
throw new AssertionError("waiting until stopping state reached stopped state to start again");
case "starting":
Expand Down Expand Up @@ -108,7 +108,7 @@ public void stopWatcher() throws Exception {
Response stopResponse = adminClient().performRequest(new Request("POST", "/_xpack/watcher/_stop"));
String body = EntityUtils.toString(stopResponse.getEntity());
assertThat(body, containsString("\"acknowledged\":true"));
break;
throw new AssertionError("waiting until started state reached stopped state");
default:
throw new AssertionError("unknown state[" + state + "]");
}
Expand Down