@Test
public void testThatRepairHaveHigherPriorityThenChecking() throws IgniteCheckedException {

    List<String> evtHist = new ArrayList<>();
    MockedProcessor processor = MockedProcessor.create(true);
    processor.useRealScheduler = true;
    processor.registerListener((stage, workload) -> {
        if (stage.equals(ReconciliationEventListener.WorkLoadStage.READY))
            evtHist.add(workload.getClass().getName());
    });
    KeyCacheObjectImpl key = new KeyCacheObjectImpl(1, null, PARTITION_ID);
    UUID nodeId1 = UUID.randomUUID();
    UUID nodeId2 = UUID.randomUUID();
    GridCacheVersion ver = new GridCacheVersion(1, 0, 0, 0);
    GridCacheVersion ver2 = new GridCacheVersion(2, 0, 0, 0);
    Map<KeyCacheObject, Map<UUID, GridCacheVersion>> batchRes = new HashMap<>();
    Map<UUID, GridCacheVersion> oldKeys = new HashMap<>();
    oldKeys.put(nodeId1, ver);
    oldKeys.put(nodeId2, ver2);
    batchRes.put(key, oldKeys);
    Map<KeyCacheObject, Map<UUID, VersionedValue>> sameRes = new HashMap<>();
    Map<UUID, VersionedValue> actualKey = new HashMap<>();
    actualKey.put(nodeId1, new VersionedValue(null, ver, 1, 1));
    actualKey.put(nodeId2, new VersionedValue(null, ver2, 1, 1));
    sameRes.put(key, actualKey);
    processor
        .addTask(new Recheck(ReconciliationExecutionContext.IGNORE_JOB_PERMITS_SESSION_ID, UUID.randomUUID(),
            batchRes, DEFAULT_CACHE, PARTITION_ID, MAX_RECHECK_ATTEMPTS, RepairRequestTask.MAX_REPAIR_ATTEMPTS))
        .addTask(new Recheck(ReconciliationExecutionContext.IGNORE_JOB_PERMITS_SESSION_ID, UUID.randomUUID(),
            batchRes, DEFAULT_CACHE, PARTITION_ID, MAX_RECHECK_ATTEMPTS, RepairRequestTask.MAX_REPAIR_ATTEMPTS))
        .whereResult(CollectPartitionKeysByRecheckRequestTask.class, new ExecutionResult<>(sameRes))
        .whereResult(RepairRequestTask.class, new ExecutionResult<>(new RepairResult()))
        .execute();
    assertEquals(RecheckRequest.class.getName(), evtHist.get(0));
    assertEquals(RepairRequest.class.getName(), evtHist.get(1));
    assertEquals(RecheckRequest.class.getName(), evtHist.get(2));
}