move verification so that test is in order (elastic/x-pack-elasticsearch#1504)
improves test by taking order of statuses into account
Original commit: elastic/x-pack-elasticsearch@0d214714d3f0cf8aa52f4bf5ab44e4a45e411593
@@ -338,13 +338,12 @@ public class AutodetectProcessManagerTests extends ESTestCase {
manager.processData(jobTask, createInputStream(""), randomFrom(XContentType.values()), mock(DataLoadParams.class),
(dataCounts1, e) -> {
});
-
+ verify(manager).setJobState(any(), eq(JobState.OPENED));
// job is created
assertEquals(1, manager.numberOfOpenJobs());
expectThrows(ElasticsearchException.class, () -> manager.closeJob(jobTask, false, null));
assertEquals(0, manager.numberOfOpenJobs());
- verify(manager).setJobState(any(), eq(JobState.OPENED));
verify(manager).setJobState(any(), eq(JobState.FAILED));
}
