diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java index c802f0bccca..55b9312f70b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java @@ -73,14 +73,13 @@ public class StopDatafeedAction extends Action { } private String datafeedId; - private String[] resolvedStartedDatafeedIds; + private String[] resolvedStartedDatafeedIds = new String[] {}; private TimeValue stopTimeout = DEFAULT_TIMEOUT; private boolean force = false; private boolean allowNoDatafeeds = true; public Request(String datafeedId) { this.datafeedId = ExceptionsHelper.requireNonNull(datafeedId, DatafeedConfig.ID.getPreferredName()); - this.resolvedStartedDatafeedIds = new String[] { datafeedId }; } public Request() { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java index 1983b314b44..94fb84d7f64 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java @@ -24,6 +24,9 @@ public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTe if (randomBoolean()) { request.setAllowNoDatafeeds(randomBoolean()); } + if (randomBoolean()) { + request.setResolvedStartedDatafeedIds(generateRandomStringArray(4, 8, false)); + } return request; }