|
25 | 25 | import java.util.Collections; |
26 | 26 | import java.util.concurrent.TimeUnit; |
27 | 27 |
|
| 28 | +import static org.elasticsearch.xpack.core.ml.MlTasks.AWAITING_UPGRADE; |
28 | 29 | import static org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase.createDatafeed; |
29 | 30 | import static org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase.createScheduledJob; |
30 | 31 | import static org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase.getDataCounts; |
|
33 | 34 | import static org.hamcrest.Matchers.empty; |
34 | 35 | import static org.hamcrest.Matchers.equalTo; |
35 | 36 | import static org.hamcrest.Matchers.is; |
36 | | -import static org.hamcrest.Matchers.isEmptyString; |
37 | 37 | import static org.hamcrest.Matchers.not; |
38 | 38 | import static org.hamcrest.Matchers.nullValue; |
39 | 39 |
|
@@ -88,12 +88,12 @@ public void testEnableUpgradeMode() throws Exception { |
88 | 88 |
|
89 | 89 | GetJobsStatsAction.Response.JobStats jobStats = getJobStats(jobId).get(0); |
90 | 90 | assertThat(jobStats.getState(), equalTo(JobState.OPENED)); |
91 | | - assertThat(jobStats.getAssignmentExplanation(), equalTo(MlTasks.AWAITING_UPGRADE.getExplanation())); |
| 91 | + assertThat(jobStats.getAssignmentExplanation(), equalTo(AWAITING_UPGRADE.getExplanation())); |
92 | 92 | assertThat(jobStats.getNode(), is(nullValue())); |
93 | 93 |
|
94 | 94 | GetDatafeedsStatsAction.Response.DatafeedStats datafeedStats = getDatafeedStats(datafeedId); |
95 | 95 | assertThat(datafeedStats.getDatafeedState(), equalTo(DatafeedState.STARTED)); |
96 | | - assertThat(datafeedStats.getAssignmentExplanation(), equalTo(MlTasks.AWAITING_UPGRADE.getExplanation())); |
| 96 | + assertThat(datafeedStats.getAssignmentExplanation(), equalTo(AWAITING_UPGRADE.getExplanation())); |
97 | 97 | assertThat(datafeedStats.getNode(), is(nullValue())); |
98 | 98 |
|
99 | 99 | Job.Builder job = createScheduledJob("job-should-not-open"); |
@@ -126,13 +126,11 @@ public void testEnableUpgradeMode() throws Exception { |
126 | 126 |
|
127 | 127 | jobStats = getJobStats(jobId).get(0); |
128 | 128 | assertThat(jobStats.getState(), equalTo(JobState.OPENED)); |
129 | | - assertThat(jobStats.getAssignmentExplanation(), isEmptyString()); |
130 | | - assertThat(jobStats.getNode(), is(not(nullValue()))); |
| 129 | + assertThat(jobStats.getAssignmentExplanation(), not(equalTo(AWAITING_UPGRADE.getExplanation()))); |
131 | 130 |
|
132 | 131 | datafeedStats = getDatafeedStats(datafeedId); |
133 | 132 | assertThat(datafeedStats.getDatafeedState(), equalTo(DatafeedState.STARTED)); |
134 | | - assertThat(datafeedStats.getAssignmentExplanation(), isEmptyString()); |
135 | | - assertThat(datafeedStats.getNode(), is(not(nullValue()))); |
| 133 | + assertThat(datafeedStats.getAssignmentExplanation(), not(equalTo(AWAITING_UPGRADE.getExplanation()))); |
136 | 134 | } |
137 | 135 |
|
138 | 136 | private void startRealtime(String jobId) throws Exception { |
|
0 commit comments