    @Test
    public void syncCheck() throws InterruptedException {

        int syncRateFactor = 1;
        int syncRateInSeconds = 1;
        SyncCheck syncCheck = SyncCheck.createForTests(syncRateFactor, 1, syncRateInSeconds);
        CheckResult notStartedCheck = syncCheck.syncCheck(scheduler);
        assertFalse(notStartedCheck.isUp());
        assertEquals(Status.DOWN, notStartedCheck.getStatus());

        int counter = 0;
        while (!syncCheck.syncCheck(scheduler).isUp() && counter < 15) {
            LOG.info("Sync has not started yet");
            TimeUnit.MILLISECONDS.sleep(500);
            counter++;
        }

        CheckResult startedCheck = syncCheck.syncCheck(scheduler);
        assertTrue(startedCheck.isUp());
        assertEquals(Status.UP, startedCheck.getStatus());

        scheduler.terminate();

        counter = 0;
        while (syncCheck.syncCheck(scheduler).isUp() && counter < syncRateInSeconds * syncRateFactor * 10) {
            LOG.info("Wait for Sync to stop");
            TimeUnit.MILLISECONDS.sleep(500);
            counter++;
        }

        CheckResult failedCheck = syncCheck.syncCheck(scheduler);

        assertFalse(failedCheck.isUp());

    }