@@ -0,0 +1,1803 @@
+package org.cloudfoundry.autosleep;%0A%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.boot.test.WebIntegrationTest;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = Application.class)%0A@WebIntegrationTest(%22server.port:0%22)//random port%0A@Slf4j%0Apublic class ClockTest %7B%0A%0A    private static final long PERIOD_IN_MILLIS = 500;%0A    private static final String TEST_ID = %2293847%22;%0A%0A    @Autowired%0A    protected Clock clock;%0A    long lastLaunchTime;%0A    private int count = 0;%0A%0A    private Runnable runnable = () -%3E %7B%0A        log.debug(%22Ticking%22);%0A        count++;%0A        lastLaunchTime = System.currentTimeMillis();%0A    %7D;%0A%0A%0A    @Test(timeout = 5000)%0A    public void testStartTimer() throws Exception %7B%0A        clock.startTimer(TEST_ID, 0, PERIOD_IN_MILLIS, TimeUnit.MILLISECONDS, runnable);%0A        while (count %3C 3) %7B%0A            Thread.sleep(200);%0A        %7D%0A        //if we reach this line before the timeout, the test worked%0A        assert true;%0A    %7D%0A%0A%0A    @Test%0A    public void testStopTimer() throws Exception %7B%0A        clock.startTimer(TEST_ID, 0, PERIOD_IN_MILLIS, TimeUnit.MILLISECONDS, runnable);%0A        Thread.sleep(1000);%0A        assertTrue(lastLaunchTime %3E= System.currentTimeMillis() - PERIOD_IN_MILLIS);%0A        clock.stopTimer(TEST_ID);%0A        Thread.sleep(1000);%0A        assertFalse(lastLaunchTime %3E= System.currentTimeMillis() - PERIOD_IN_MILLIS);%0A    %7D%0A%7D%0A

Add test for Clock