From 4bb57137a9eb353d7cb596ef4293efa6086ff615 Mon Sep 17 00:00:00 2001 From: Dimitrios Athanasiou Date: Wed, 22 Feb 2017 14:42:14 +0000 Subject: [PATCH] fix unit test Original commit: elastic/x-pack-elasticsearch@af9276f02fd146b7241ae8ecbc6250d678c0bdc1 --- .../xpack/ml/job/persistence/JobProviderTests.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobProviderTests.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobProviderTests.java index 9dd5300ed12..8c22a2221c2 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobProviderTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobProviderTests.java @@ -1270,12 +1270,14 @@ public class JobProviderTests extends ESTestCase { MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME).addClusterStatusYellowResponse() .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), CategorizerState.TYPE, JOB_ID + "_1", categorizerStateGetResponse1) .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), CategorizerState.TYPE, JOB_ID + "_2", categorizerStateGetResponse2) - .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), ModelState.TYPE.getPreferredName(), "123_1", modelStateGetResponse1) - .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), ModelState.TYPE.getPreferredName(), "123_2", modelStateGetResponse2); + .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), ModelState.TYPE.getPreferredName(), JOB_ID + "-123_1", + modelStateGetResponse1) + .prepareGet(AnomalyDetectorsIndex.jobStateIndexName(), ModelState.TYPE.getPreferredName(), JOB_ID + "-123_2", + modelStateGetResponse2); JobProvider provider = createProvider(clientBuilder.build()); - ModelSnapshot modelSnapshot = new ModelSnapshot(randomAsciiOfLengthBetween(1, 20)); + ModelSnapshot modelSnapshot = new ModelSnapshot(JOB_ID); modelSnapshot.setSnapshotId("123"); modelSnapshot.setSnapshotDocCount(2);