diff --git a/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningClientActionPlugin.java b/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningClientActionPlugin.java index 59ee70ebad2..59e36a4555a 100644 --- a/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningClientActionPlugin.java +++ b/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningClientActionPlugin.java @@ -5,10 +5,6 @@ */ package org.elasticsearch.xpack.core.ml; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; - public interface MachineLearningClientActionPlugin { } diff --git a/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java new file mode 100644 index 00000000000..a8224d31d8d --- /dev/null +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.xpack.core.ml.action; + +import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.xpack.core.ml.action.CloseJobAction.Request; + +public class CloseJobActionRequestTests extends AbstractStreamableXContentTestCase { + + @Override + protected Request createTestInstance() { + Request request = new Request(randomAlphaOfLengthBetween(1, 20)); + if (randomBoolean()) { + request.setCloseTimeout(TimeValue.timeValueMillis(randomNonNegativeLong())); + } + if (randomBoolean()) { + request.setForce(randomBoolean()); + } + if (randomBoolean()) { + request.setAllowNoJobs(randomBoolean()); + } + return request; + } + + @Override + protected boolean supportsUnknownFields() { + return false; + } + + @Override + protected Request createBlankInstance() { + return new Request(); + } + + @Override + protected Request doParseInstance(XContentParser parser) { + return Request.parseRequest(null, parser); + } +} diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionResponseTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionResponseTests.java index 93bac8f518b..c558a5cba0c 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.CloseJobAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteCalendarEventActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventActionRequestTests.java similarity index 86% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteCalendarEventActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventActionRequestTests.java index 99d441708ee..e6f35c76b78 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteCalendarEventActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventActionRequestTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction; import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction.Request; public class DeleteCalendarEventActionRequestTests extends AbstractStreamableTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedRequestTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedRequestTests.java index 23336d44c98..47cf3dc5eec 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteDatafeedRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.DeleteDatafeedAction.Request; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteExpiredDataActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataActionResponseTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteExpiredDataActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataActionResponseTests.java index ec94e087483..34a03fb2e40 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteExpiredDataActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.DeleteExpiredDataAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteJobRequestTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteJobRequestTests.java index fa780a18b00..2482e9b5625 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteJobRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.DeleteJobAction; diff --git a/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java new file mode 100644 index 00000000000..cdcac09e073 --- /dev/null +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.xpack.core.ml.action; + +import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.xpack.core.ml.action.ForecastJobAction.Request; + +import static org.hamcrest.Matchers.equalTo; + +public class ForecastJobActionRequestTests extends AbstractStreamableXContentTestCase { + + @Override + protected Request doParseInstance(XContentParser parser) { + return Request.parseRequest(null, parser); + } + + @Override + protected boolean supportsUnknownFields() { + return false; + } + + @Override + protected Request createTestInstance() { + Request request = new Request(randomAlphaOfLengthBetween(1, 20)); + if (randomBoolean()) { + request.setDuration(TimeValue.timeValueSeconds(randomIntBetween(1, 1_000_000)).getStringRep()); + } + if (randomBoolean()) { + request.setExpiresIn(TimeValue.timeValueSeconds(randomIntBetween(0, 1_000_000)).getStringRep()); + } + return request; + } + + @Override + protected Request createBlankInstance() { + return new Request(); + } + + public void testSetDuration_GivenZero() { + IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setDuration("0")); + assertThat(e.getMessage(), equalTo("[duration] must be positive: [0ms]")); + } + + public void testSetDuration_GivenNegative() { + IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setDuration("-1s")); + assertThat(e.getMessage(), equalTo("[duration] must be positive: [-1]")); + } + + public void testSetExpiresIn_GivenZero() { + Request request = new Request(); + request.setExpiresIn("0"); + assertThat(request.getExpiresIn(), equalTo(TimeValue.ZERO)); + } + + public void testSetExpiresIn_GivenNegative() { + IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setExpiresIn("-1s")); + assertThat(e.getMessage(), equalTo("[expires_in] must be non-negative: [-1]")); + } +} diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionResponseTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionResponseTests.java index 123c40ddde2..b6c0759bceb 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.ForecastJobAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java index 08f39238f05..4d1c1ca6084 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionResponseTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionResponseTests.java index 17f7d98378b..4fbb7a92496 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetBucketActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetBucketsAction; import org.elasticsearch.xpack.core.ml.action.GetBucketsAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarEventsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarEventsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java index 95c0e5dc61b..eccfd933e5a 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarEventsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.xcontent.XContentParser; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java index 80ea99b571f..33584567ef4 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCalendarsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java index 1ef80abefe8..7e53317478c 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesResponseTests.java similarity index 90% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesResponseTests.java index a149e728e0d..c77d000bb5f 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetCategoriesResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetCategoriesAction; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.results.CategoryDefinition; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionRequestTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionRequestTests.java index 1eed91c171d..37a539c0021 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.io.stream.Writeable; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java index 676352ce9fd..26716695c6e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedStatsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionRequestTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionRequestTests.java index 14f0f882fcc..5fbdfd2e8cb 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.io.stream.Writeable; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionResponseTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionResponseTests.java index 27ad882c258..f5eef5f1776 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetDatafeedsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionRequestTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionRequestTests.java index bb88839d6e2..234da4d9af5 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.GetFiltersAction; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionResponseTests.java similarity index 91% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionResponseTests.java index f60444a2fa2..c8465c87587 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetFiltersActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetFiltersActionResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetFiltersAction; import org.elasticsearch.xpack.core.ml.action.GetFiltersAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java index 742e94c7bfa..af0e1f856f8 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction; import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Request; import org.elasticsearch.xpack.core.ml.action.util.PageParams; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionResponseTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionResponseTests.java index c97c2441e93..daeda3ed82a 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetInfluencersActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction; import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.results.Influencer; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionRequestTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionRequestTests.java index 232908a6250..913618de38b 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.test.AbstractStreamableTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionResponseTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionResponseTests.java index 6a71f767905..ff979a8570a 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobStatsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobStatsActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -15,7 +15,7 @@ import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.config.JobState; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.DataCountsTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCountsTests; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSizeStats; import java.net.InetAddress; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionRequestTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionRequestTests.java index 8c746d2504c..326df1b2989 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.io.stream.Writeable; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionResponseTests.java similarity index 92% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionResponseTests.java index 719755c5ead..fee8a3a8e82 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetJobsActionResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetJobsAction; import org.elasticsearch.xpack.core.ml.action.GetJobsAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java index c6ee60aaf56..ffef7579601 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Request; import org.elasticsearch.xpack.core.ml.action.util.PageParams; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionResponseTests.java similarity index 86% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionResponseTests.java index 52072aa0aa2..0cf34c66f24 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetModelSnapshotsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionResponseTests.java @@ -3,14 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.ModelSnapshotTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests; import java.util.ArrayList; import java.util.List; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java index d2a6bf22789..9799010204c 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentParser; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionResponseTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionResponseTests.java index a93d0cc1517..8873b340c12 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetOverallBucketsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.GetOverallBucketsAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java index fb394f3d060..f710fcc6c1a 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.GetRecordsAction; import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Request; import org.elasticsearch.xpack.core.ml.action.util.PageParams; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionResponseTests.java similarity index 92% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionResponseTests.java index 8ecdea0113e..78630e0cf0f 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetRecordsActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionResponseTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.GetRecordsAction; import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Response; import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java similarity index 92% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java index 71c227955e9..de85907a83e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.OpenJobAction; import org.elasticsearch.xpack.core.ml.action.OpenJobAction.Request; public class OpenJobActionRequestTests extends AbstractStreamableXContentTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostCalendarEventActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostCalendarEventActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java index 5b21908c402..ce6a64be6c5 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostCalendarEventActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.Strings; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java index c1730162a98..ba4a3ff0647 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.PostDataAction; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; import org.elasticsearch.xpack.core.ml.job.config.DataDescription.DataFormat; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionResponseTests.java similarity index 81% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionResponseTests.java index 22d604825c1..2f1a9d2e27d 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionResponseTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.PostDataAction; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.DataCountsTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCountsTests; public class PostDataActionResponseTests extends AbstractStreamableTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushRequestTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushRequestTests.java index bc91699037a..a4fd8c3c470 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.FlushJobAction.Request; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushResponseTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushResponseTests.java index 4b6755121c9..14f067e38ad 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PostDataFlushResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataFlushResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.FlushJobAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java index e8f2e99087e..b7828e4b976 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.PreviewDatafeedAction.Request; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java similarity index 87% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java index da3d60e816e..7d111a31c9d 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java @@ -3,13 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.PutCalendarAction; +import org.elasticsearch.xpack.core.ml.calendars.CalendarTests; import org.elasticsearch.xpack.core.ml.job.config.JobTests; -import org.elasticsearch.xpack.ml.calendars.CalendarTests; public class PutCalendarActionRequestTests extends AbstractStreamableXContentTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionResponseTests.java similarity index 80% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionResponseTests.java index 2c80dfb5600..941de884554 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutCalendarActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionResponseTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.PutCalendarAction; -import org.elasticsearch.xpack.ml.calendars.CalendarTests; +import org.elasticsearch.xpack.core.ml.calendars.CalendarTests; public class PutCalendarActionResponseTests extends AbstractStreamableTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java index bba1727f708..f01a360f909 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionResponseTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionResponseTests.java index 7855e0f39f2..e72ac3c726e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutDatafeedActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutFilterActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutFilterActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java index 03c6c55df8a..21845922470 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutFilterActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.PutFilterAction; import org.elasticsearch.xpack.core.ml.action.PutFilterAction.Request; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionRequestTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionRequestTests.java index 0d87f9ae86a..039954f1414 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionResponseTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionResponseTests.java index 5779f3e72fc..080fbb25e71 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PutJobActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutJobActionResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.xpack.core.ml.action.PutJobAction.Response; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java index d5038cc1af9..cd1b48cb31a 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionResponseTests.java similarity index 80% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionResponseTests.java index 14e9dcbb973..f24a8ccb9e1 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/RevertModelSnapshotActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionResponseTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction; import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction.Response; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.ModelSnapshotTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests; public class RevertModelSnapshotActionResponseTests extends AbstractStreamableTestCase { diff --git a/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java new file mode 100644 index 00000000000..1983b314b44 --- /dev/null +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.xpack.core.ml.action; + +import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction.Request; + +public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTestCase { + + @Override + protected Request createTestInstance() { + Request request = new Request(randomAlphaOfLengthBetween(1, 20)); + if (randomBoolean()) { + request.setStopTimeout(TimeValue.timeValueMillis(randomNonNegativeLong())); + } + if (randomBoolean()) { + request.setForce(randomBoolean()); + } + if (randomBoolean()) { + request.setAllowNoDatafeeds(randomBoolean()); + } + return request; + } + + @Override + protected boolean supportsUnknownFields() { + return false; + } + + @Override + protected Request createBlankInstance() { + return new Request(); + } + + @Override + protected Request doParseInstance(XContentParser parser) { + return Request.parseRequest(null, parser); + } +} diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateCalendarJobActionResquestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobActionResquestTests.java similarity index 88% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateCalendarJobActionResquestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobActionResquestTests.java index 3e86353cf1d..efaf87c8681 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateCalendarJobActionResquestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobActionResquestTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.UpdateCalendarJobAction; public class UpdateCalendarJobActionResquestTests extends AbstractStreamableTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateDatafeedActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateDatafeedActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java index 8a77e7499d5..af883ee9164 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateDatafeedActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateJobActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateJobActionRequestTests.java similarity index 91% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateJobActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateJobActionRequestTests.java index e129772d288..2db1571a39b 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateJobActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateJobActionRequestTests.java @@ -3,10 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.UpdateJobAction; import org.elasticsearch.xpack.core.ml.job.config.AnalysisLimits; import org.elasticsearch.xpack.core.ml.job.config.JobUpdate; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java similarity index 92% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java index ef00ffb04b7..8ccb8bb2e19 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; -import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction; import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction.Request; public class UpdateModelSnapshotActionRequestTests diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionResponseTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionResponseTests.java similarity index 79% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionResponseTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionResponseTests.java index 15c63c5cf1e..a8694476ee2 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateModelSnapshotActionResponseTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionResponseTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction; import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction.Response; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.ModelSnapshotTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests; public class UpdateModelSnapshotActionResponseTests extends AbstractStreamableTestCase { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateProcessActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessActionRequestTests.java similarity index 90% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateProcessActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessActionRequestTests.java index 0fca50b49bb..f7ee459bb19 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/UpdateProcessActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessActionRequestTests.java @@ -3,13 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.test.AbstractStreamableTestCase; -import org.elasticsearch.xpack.core.ml.action.UpdateProcessAction; import org.elasticsearch.xpack.core.ml.job.config.JobUpdate; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; -import org.elasticsearch.xpack.ml.job.config.MlFilterTests; +import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests; import org.elasticsearch.xpack.core.ml.job.config.ModelPlotConfig; import java.util.ArrayList; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateDetectorActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateDetectorActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java index 8d880e5506b..d49908b1f1b 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateDetectorActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateJobConfigActionRequestTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateJobConfigActionRequestTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java index 4f3b258ddae..63cfeb0d10e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ValidateJobConfigActionRequestTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action; +package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.ToXContent; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/PageParamsTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/PageParamsTests.java similarity index 97% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/PageParamsTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/PageParamsTests.java index 9e57c17d2ff..78a47fb068d 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/PageParamsTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/PageParamsTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action.util; +package org.elasticsearch.xpack.core.ml.action.util; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.action.util.PageParams; import java.io.IOException; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/QueryPageTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/QueryPageTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/QueryPageTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/QueryPageTests.java index 944a600a4c0..8bded1972f2 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/util/QueryPageTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/util/QueryPageTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.action.util; +package org.elasticsearch.xpack.core.ml.action.util; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.ml.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.results.Influencer; import java.io.IOException; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/calendars/CalendarTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java similarity index 95% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/calendars/CalendarTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java index 4040db5fc9e..4260fbfd46e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/calendars/CalendarTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.calendars; +package org.elasticsearch.xpack.core.ml.calendars; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.calendars.Calendar; import org.elasticsearch.xpack.core.ml.job.config.JobTests; import java.io.IOException; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/MlFilterTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/MlFilterTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java index 64b76b8c0eb..42102b540f9 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/MlFilterTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.config; +package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.job.config.MlFilter; import java.util.ArrayList; import java.util.Collections; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/ModelPlotConfigTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java similarity index 91% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/ModelPlotConfigTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java index 7b9a94eb009..aa54a174194 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/ModelPlotConfigTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.config; +package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.job.config.ModelPlotConfig; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/DataCountsTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/DataCountsTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java index f1ab23a821a..091e6887701 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/DataCountsTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java @@ -3,12 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.process.autodetect.state; +package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; import org.joda.time.DateTime; import java.util.Date; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSizeStatsTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSizeStatsTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java index 010c4590c87..fbe8e769085 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSizeStatsTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.process.autodetect.state; +package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.TimeValue; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSnapshotTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSnapshotTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java index 42bd034c6cb..91518f8eb28 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/ModelSnapshotTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java @@ -3,15 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.process.autodetect.state; +package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSizeStats; -import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; -import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles; import java.util.Arrays; import java.util.Date; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/QuantilesTests.java b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java similarity index 94% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/QuantilesTests.java rename to plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java index 935adf05498..93bddbed0ff 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/state/QuantilesTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java @@ -3,13 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.ml.job.process.autodetect.state; +package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles; import java.util.Date; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlAssignmentNotifierTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlAssignmentNotifierTests.java index b76b8fb439a..87b0b0bec34 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlAssignmentNotifierTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlAssignmentNotifierTests.java @@ -22,7 +22,7 @@ import org.elasticsearch.xpack.ml.notifications.Auditor; import java.net.InetAddress; import java.util.Collections; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java index ea10b21e94a..84b5aefcd29 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.xpack.core.ml.job.config.JobState; import org.elasticsearch.xpack.core.ml.job.config.JobTaskStatus; import org.elasticsearch.xpack.core.ml.job.config.JobTests; import org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData; +import org.elasticsearch.xpack.ml.datafeed.DatafeedManagerTests; import java.util.Collections; import java.util.Date; @@ -37,7 +38,7 @@ import java.util.Map; import static org.elasticsearch.xpack.core.ml.job.config.JobTests.buildJobBuilder; import static org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData.INITIAL_ASSIGNMENT; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.elasticsearch.xpack.ml.datafeed.DatafeedManagerTests.createDatafeedConfig; import static org.elasticsearch.xpack.ml.datafeed.DatafeedManagerTests.createDatafeedJob; import static org.hamcrest.Matchers.contains; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionRequestTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportCloseJobActionTests.java similarity index 93% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionRequestTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportCloseJobActionTests.java index 517ef47f24a..92721c1e7a1 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/CloseJobActionRequestTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportCloseJobActionTests.java @@ -16,11 +16,9 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ml.MLMetadataField; @@ -43,41 +41,11 @@ import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class CloseJobActionRequestTests extends AbstractStreamableXContentTestCase { - - @Override - protected Request createTestInstance() { - Request request = new Request(randomAlphaOfLengthBetween(1, 20)); - if (randomBoolean()) { - request.setCloseTimeout(TimeValue.timeValueMillis(randomNonNegativeLong())); - } - if (randomBoolean()) { - request.setForce(randomBoolean()); - } - if (randomBoolean()) { - request.setAllowNoJobs(randomBoolean()); - } - return request; - } - - @Override - protected boolean supportsUnknownFields() { - return false; - } - - @Override - protected Request createBlankInstance() { - return new Request(); - } - - @Override - protected Request doParseInstance(XContentParser parser) { - return Request.parseRequest(null, parser); - } +public class TransportCloseJobActionTests extends ESTestCase { public void testValidate_datafeedIsStarted() { MlMetadata.Builder mlBuilder = new MlMetadata.Builder(); diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobActionTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportDeleteJobActionTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobActionTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportDeleteJobActionTests.java index 7c9d3e38e66..1bf40ac881e 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/DeleteJobActionTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportDeleteJobActionTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase; import java.util.Date; -public class DeleteJobActionTests extends ESTestCase { +public class TransportDeleteJobActionTests extends ESTestCase { public void testJobIsDeletedFromState() { MlMetadata mlMetadata = MlMetadata.EMPTY_METADATA; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionRequestTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportForecastJobActionRequestTests.java similarity index 60% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionRequestTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportForecastJobActionRequestTests.java index 6da7daaf39c..be115af6bcd 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/ForecastJobActionRequestTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportForecastJobActionRequestTests.java @@ -8,10 +8,8 @@ package org.elasticsearch.xpack.ml.action; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.action.ForecastJobAction; -import org.elasticsearch.xpack.core.ml.action.ForecastJobAction.Request; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; import org.elasticsearch.xpack.core.ml.job.config.Detector; @@ -20,57 +18,7 @@ import org.elasticsearch.xpack.core.ml.job.config.Job; import java.util.Collections; import java.util.Date; -import static org.hamcrest.Matchers.equalTo; - -public class ForecastJobActionRequestTests extends AbstractStreamableXContentTestCase { - - @Override - protected Request doParseInstance(XContentParser parser) { - return Request.parseRequest(null, parser); - } - - @Override - protected boolean supportsUnknownFields() { - return false; - } - - @Override - protected Request createTestInstance() { - Request request = new Request(randomAlphaOfLengthBetween(1, 20)); - if (randomBoolean()) { - request.setDuration(TimeValue.timeValueSeconds(randomIntBetween(1, 1_000_000)).getStringRep()); - } - if (randomBoolean()) { - request.setExpiresIn(TimeValue.timeValueSeconds(randomIntBetween(0, 1_000_000)).getStringRep()); - } - return request; - } - - @Override - protected Request createBlankInstance() { - return new Request(); - } - - public void testSetDuration_GivenZero() { - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setDuration("0")); - assertThat(e.getMessage(), equalTo("[duration] must be positive: [0ms]")); - } - - public void testSetDuration_GivenNegative() { - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setDuration("-1s")); - assertThat(e.getMessage(), equalTo("[duration] must be positive: [-1]")); - } - - public void testSetExpiresIn_GivenZero() { - Request request = new Request(); - request.setExpiresIn("0"); - assertThat(request.getExpiresIn(), equalTo(TimeValue.ZERO)); - } - - public void testSetExpiresIn_GivenNegative() { - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new Request().setExpiresIn("-1s")); - assertThat(e.getMessage(), equalTo("[expires_in] must be non-negative: [-1]")); - } +public class TransportForecastJobActionRequestTests extends ESTestCase { public void testValidate_jobVersionCannonBeBefore61() { Job.Builder jobBuilder = createTestJob("forecast-it-test-job-version"); diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsStatsActionTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsActionTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsStatsActionTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsActionTests.java index 115ec09d986..40bc82c6048 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/GetJobsStatsActionTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsActionTests.java @@ -23,7 +23,7 @@ import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class GetJobsStatsActionTests extends ESTestCase { +public class TransportGetJobsStatsActionTests extends ESTestCase { public void testDetermineJobIds() { diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportOpenJobActionTests.java similarity index 99% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportOpenJobActionTests.java index a8b280ec1fe..d11783c4789 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportOpenJobActionTests.java @@ -61,7 +61,7 @@ import static org.hamcrest.Matchers.containsString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class OpenJobActionTests extends ESTestCase { +public class TransportOpenJobActionTests extends ESTestCase { public void testValidate_jobMissing() { MlMetadata.Builder mlBuilder = new MlMetadata.Builder(); diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedActionTests.java similarity index 98% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedActionTests.java index 39949c52d4f..c63efb9a909 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/PreviewDatafeedActionTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedActionTests.java @@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class PreviewDatafeedActionTests extends ESTestCase { +public class TransportPreviewDatafeedActionTests extends ESTestCase { private DataExtractor dataExtractor; private ActionListener actionListener; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StartDatafeedActionTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java similarity index 96% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StartDatafeedActionTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java index 656c0da89ce..cb5d2470aaa 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StartDatafeedActionTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java @@ -22,10 +22,10 @@ import java.util.Collections; import java.util.Date; import static org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData.INITIAL_ASSIGNMENT; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.hamcrest.Matchers.equalTo; -public class StartDatafeedActionTests extends ESTestCase { +public class TransportStartDatafeedActionTests extends ESTestCase { public void testValidate_GivenDatafeedIsMissing() { Job job = DatafeedManagerTests.createDatafeedJob().build(new Date()); diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StopDatafeedActionRequestTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedActionTests.java similarity index 81% rename from plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StopDatafeedActionRequestTests.java rename to plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedActionTests.java index c6eadcbcbec..519336c9f09 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/StopDatafeedActionRequestTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedActionTests.java @@ -6,20 +6,15 @@ package org.elasticsearch.xpack.ml.action; import org.elasticsearch.ResourceNotFoundException; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractStreamableXContentTestCase; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.MLMetadataField; import org.elasticsearch.xpack.core.ml.MlMetadata; -import org.elasticsearch.xpack.core.ml.MlMetadata.Builder; import org.elasticsearch.xpack.core.ml.action.StartDatafeedAction; import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction.Request; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedState; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData; -import org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData.Assignment; import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase; import java.util.ArrayList; @@ -31,42 +26,11 @@ import static org.elasticsearch.xpack.ml.datafeed.DatafeedManagerTests.createDat import static org.elasticsearch.xpack.ml.datafeed.DatafeedManagerTests.createDatafeedJob; import static org.hamcrest.Matchers.equalTo; -public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTestCase { - - @Override - protected Request createTestInstance() { - Request request = new Request(randomAlphaOfLengthBetween(1, 20)); - if (randomBoolean()) { - request.setStopTimeout(TimeValue.timeValueMillis(randomNonNegativeLong())); - } - if (randomBoolean()) { - request.setForce(randomBoolean()); - } - if (randomBoolean()) { - request.setAllowNoDatafeeds(randomBoolean()); - } - return request; - } - - @Override - protected boolean supportsUnknownFields() { - return false; - } - - @Override - protected Request createBlankInstance() { - return new Request(); - } - - @Override - protected Request doParseInstance(XContentParser parser) { - return Request.parseRequest(null, parser); - } - +public class TransportStopDatafeedActionTests extends ESTestCase { public void testValidate() { PersistentTasksCustomMetaData.Builder tasksBuilder = PersistentTasksCustomMetaData.builder(); tasksBuilder.addTask(MLMetadataField.datafeedTaskId("foo"), StartDatafeedAction.TASK_NAME, - new StartDatafeedAction.DatafeedParams("foo", 0L), new Assignment("node_id", "")); + new StartDatafeedAction.DatafeedParams("foo", 0L), new PersistentTasksCustomMetaData.Assignment("node_id", "")); tasksBuilder.updateTaskStatus(MLMetadataField.datafeedTaskId("foo"), DatafeedState.STARTED); tasksBuilder.build(); @@ -84,7 +48,7 @@ public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTe } public void testResolveDataFeedIds_GivenDatafeedId() { - Builder mlMetadataBuilder = new MlMetadata.Builder(); + MlMetadata.Builder mlMetadataBuilder = new MlMetadata.Builder(); PersistentTasksCustomMetaData.Builder tasksBuilder = PersistentTasksCustomMetaData.builder(); addTask("datafeed_1", 0L, "node-1", DatafeedState.STARTED, tasksBuilder); @@ -116,7 +80,7 @@ public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTe } public void testResolveDataFeedIds_GivenAll() { - Builder mlMetadataBuilder = new MlMetadata.Builder(); + MlMetadata.Builder mlMetadataBuilder = new MlMetadata.Builder(); PersistentTasksCustomMetaData.Builder tasksBuilder = PersistentTasksCustomMetaData.builder(); addTask("datafeed_1", 0L, "node-1", DatafeedState.STARTED, tasksBuilder); @@ -155,8 +119,8 @@ public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTe public static void addTask(String datafeedId, long startTime, String nodeId, DatafeedState state, PersistentTasksCustomMetaData.Builder taskBuilder) { taskBuilder.addTask(MLMetadataField.datafeedTaskId(datafeedId), StartDatafeedAction.TASK_NAME, - new StartDatafeedAction.DatafeedParams(datafeedId, startTime), new Assignment(nodeId, "test assignment")); + new StartDatafeedAction.DatafeedParams(datafeedId, startTime), + new PersistentTasksCustomMetaData.Assignment(nodeId, "test assignment")); taskBuilder.updateTaskStatus(MLMetadataField.datafeedTaskId(datafeedId), state); } - } diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManagerTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManagerTests.java index 59c7236d28d..2f20fbdbc39 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManagerTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManagerTests.java @@ -38,7 +38,7 @@ import org.elasticsearch.xpack.core.ml.notifications.AuditorField; import org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData; import org.elasticsearch.xpack.core.persistent.PersistentTasksCustomMetaData.PersistentTask; import org.elasticsearch.xpack.ml.MachineLearning; -import org.elasticsearch.xpack.ml.action.StartDatafeedActionTests; +import org.elasticsearch.xpack.ml.action.TransportStartDatafeedActionTests; import org.elasticsearch.xpack.ml.action.TransportStartDatafeedAction.DatafeedTask; import org.elasticsearch.xpack.ml.job.persistence.MockClientBuilder; import org.elasticsearch.xpack.ml.notifications.Auditor; @@ -52,7 +52,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.function.Consumer; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.any; @@ -199,7 +199,7 @@ public class DatafeedManagerTests extends ESTestCase { Consumer handler = mockConsumer(); StartDatafeedAction.DatafeedParams params = new StartDatafeedAction.DatafeedParams("datafeed_id", 0L); - DatafeedTask task = StartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, + DatafeedTask task = TransportStartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, params, datafeedManager); task = spyDatafeedTask(task); datafeedManager.run(task, handler); @@ -218,7 +218,7 @@ public class DatafeedManagerTests extends ESTestCase { Consumer handler = mockConsumer(); StartDatafeedAction.DatafeedParams params = new StartDatafeedAction.DatafeedParams("datafeed_id", 0L); - DatafeedTask task = StartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, + DatafeedTask task = TransportStartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, params, datafeedManager); task = spyDatafeedTask(task); datafeedManager.run(task, handler); @@ -234,7 +234,7 @@ public class DatafeedManagerTests extends ESTestCase { Consumer handler = mockConsumer(); boolean cancelled = randomBoolean(); StartDatafeedAction.DatafeedParams params = new StartDatafeedAction.DatafeedParams("datafeed_id", 0L); - DatafeedTask task = StartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, + DatafeedTask task = TransportStartDatafeedActionTests.createDatafeedTask(1, "type", "action", null, params, datafeedManager); task = spyDatafeedTask(task); datafeedManager.run(task, handler); diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedNodeSelectorTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedNodeSelectorTests.java index bcb67fed6bd..eae925d1503 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedNodeSelectorTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedNodeSelectorTests.java @@ -41,7 +41,7 @@ import java.util.Collections; import java.util.Date; import java.util.List; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase.createDatafeed; import static org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase.createScheduledJob; import static org.hamcrest.Matchers.containsString; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/JobProviderIT.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/JobProviderIT.java index eae38e6b5aa..c27e3923605 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/JobProviderIT.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/JobProviderIT.java @@ -52,7 +52,7 @@ import org.elasticsearch.xpack.ml.MlSingleNodeTestCase; import org.elasticsearch.xpack.ml.job.persistence.JobDataCountsPersister; import org.elasticsearch.xpack.ml.job.persistence.JobProvider; import org.elasticsearch.xpack.ml.job.persistence.JobResultsPersister; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.DataCountsTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCountsTests; import org.junit.Before; import java.io.IOException; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java index f967cddadab..ae40db716ea 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java @@ -49,7 +49,7 @@ import java.util.Date; import java.util.List; import static org.elasticsearch.xpack.core.ml.job.config.JobTests.buildJobBuilder; -import static org.elasticsearch.xpack.ml.action.OpenJobActionTests.addJobTask; +import static org.elasticsearch.xpack.ml.action.TransportOpenJobActionTests.addJobTask; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; diff --git a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java index a685820430f..bf9a6f0a99f 100644 --- a/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java +++ b/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.xpack.core.ml.job.results.Forecast; import org.elasticsearch.xpack.core.ml.job.results.ForecastRequestStats; import org.elasticsearch.xpack.core.ml.job.results.Influencer; import org.elasticsearch.xpack.core.ml.job.results.ModelPlot; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.ModelSnapshotTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotTests; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles; -import org.elasticsearch.xpack.ml.job.process.autodetect.state.QuantilesTests; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.QuantilesTests; import java.util.ArrayList; import java.util.Date;