Skip to content

Commit

Permalink
[ML][TEST] fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Dec 13, 2018
1 parent 2c872a5 commit 76858bb
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@

public class MlMigrationIT extends AbstractUpgradeTestCase {

private static final String OLD_CLUSTER_OPEN_JOB_ID = "ml-migration-it-old-cluster-open-job";
private static final String OLD_CLUSTER_STARTED_DATAFEED_ID = "ml-migration-it-old-cluster-started-datafeed";
private static final String OLD_CLUSTER_CLOSED_JOB_ID = "ml-migration-it-old-cluster-closed-job";
private static final String OLD_CLUSTER_STOPPED_DATAFEED_ID = "ml-migration-it-old-cluster-stopped-datafeed";
private static final String OLD_CLUSTER_CLOSED_JOB_EXTRA_ID = "ml-migration-it-old-cluster-closed-job-extra";
private static final String OLD_CLUSTER_STOPPED_DATAFEED_EXTRA_ID = "ml-migration-it-old-cluster-stopped-datafeed-extra";
private static final String PREFIX = "ml-migration-it-";
private static final String OLD_CLUSTER_OPEN_JOB_ID = PREFIX + "old-cluster-open-job";
private static final String OLD_CLUSTER_STARTED_DATAFEED_ID = PREFIX + "old-cluster-started-datafeed";
private static final String OLD_CLUSTER_CLOSED_JOB_ID = PREFIX + "old-cluster-closed-job";
private static final String OLD_CLUSTER_STOPPED_DATAFEED_ID = PREFIX + "old-cluster-stopped-datafeed";
private static final String OLD_CLUSTER_CLOSED_JOB_EXTRA_ID = PREFIX + "old-cluster-closed-job-extra";
private static final String OLD_CLUSTER_STOPPED_DATAFEED_EXTRA_ID = PREFIX + "old-cluster-stopped-datafeed-extra";

@Override
protected Collection<String> templatesToWaitFor() {
Expand Down Expand Up @@ -256,7 +257,7 @@ private void checkJobs() throws IOException {
return;
}

Request getJobs = new Request("GET", "_xpack/ml/anomaly_detectors/migration*");
Request getJobs = new Request("GET", "_xpack/ml/anomaly_detectors/" + PREFIX + "*");
Response response = client().performRequest(getJobs);

Map<String, Object> jobs = entityAsMap(response);
Expand All @@ -277,7 +278,7 @@ private void checkJobs() throws IOException {
assertNull(customSettings.get("migrated from version"));
}

Request getJobStats = new Request("GET", "_xpack/ml/anomaly_detectors/migration*/_stats");
Request getJobStats = new Request("GET", "_xpack/ml/anomaly_detectors/"+ PREFIX + "*/_stats");
response = client().performRequest(getJobStats);

Map<String, Object> stats = entityAsMap(response);
Expand All @@ -301,7 +302,7 @@ private void checkDatafeeds() throws IOException {
return;
}

Request getDatafeeds = new Request("GET", "_xpack/ml/datafeeds/migration*");
Request getDatafeeds = new Request("GET", "_xpack/ml/datafeeds/" + PREFIX + "*");
Response response = client().performRequest(getDatafeeds);
List<Map<String, Object>> configs =
(List<Map<String, Object>>) XContentMapValues.extractValue("datafeeds", entityAsMap(response));
Expand All @@ -310,7 +311,7 @@ private void checkDatafeeds() throws IOException {
assertEquals(OLD_CLUSTER_STOPPED_DATAFEED_ID, XContentMapValues.extractValue("datafeed_id", configs.get(1)));
assertEquals(OLD_CLUSTER_STOPPED_DATAFEED_EXTRA_ID, XContentMapValues.extractValue("datafeed_id", configs.get(2)));

Request getDatafeedStats = new Request("GET", "_xpack/ml/datafeeds/migration*/_stats");
Request getDatafeedStats = new Request("GET", "_xpack/ml/datafeeds/" + PREFIX + "*/_stats");
response = client().performRequest(getDatafeedStats);
configs = (List<Map<String, Object>>) XContentMapValues.extractValue("datafeeds", entityAsMap(response));
assertThat(configs, hasSize(3));
Expand Down

0 comments on commit 76858bb

Please sign in to comment.