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@0d214714d3
This commit is contained in:
parent
1873624a18
commit
edc299a532
|
@ -338,13 +338,12 @@ public class AutodetectProcessManagerTests extends ESTestCase {
|
||||||
manager.processData(jobTask, createInputStream(""), randomFrom(XContentType.values()), mock(DataLoadParams.class),
|
manager.processData(jobTask, createInputStream(""), randomFrom(XContentType.values()), mock(DataLoadParams.class),
|
||||||
(dataCounts1, e) -> {
|
(dataCounts1, e) -> {
|
||||||
});
|
});
|
||||||
|
verify(manager).setJobState(any(), eq(JobState.OPENED));
|
||||||
// job is created
|
// job is created
|
||||||
assertEquals(1, manager.numberOfOpenJobs());
|
assertEquals(1, manager.numberOfOpenJobs());
|
||||||
expectThrows(ElasticsearchException.class, () -> manager.closeJob(jobTask, false, null));
|
expectThrows(ElasticsearchException.class, () -> manager.closeJob(jobTask, false, null));
|
||||||
assertEquals(0, manager.numberOfOpenJobs());
|
assertEquals(0, manager.numberOfOpenJobs());
|
||||||
|
|
||||||
verify(manager).setJobState(any(), eq(JobState.OPENED));
|
|
||||||
verify(manager).setJobState(any(), eq(JobState.FAILED));
|
verify(manager).setJobState(any(), eq(JobState.FAILED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue