@@ -0,0 +1,2680 @@
+package uk.ac.ebi.quickgo.rest.period;%0A%0Aimport java.time.*;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.core.Is.is;%0A%0A/**%0A * Test calculation of remaining time calculated by AlarmClockMonthTime.%0A *%0A * @author Tony Wardell%0A * Date: 11/04/2017%0A * Time: 15:07%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class AlarmClockMonthTimeTest %7B%0A%0A    private MonthTime monthTimeMarch;%0A    private MonthTime monthTimeOctober;%0A    private AlarmClockMonthTime alarmClock;%0A    private LocalDateTime input;%0A%0A    @Before%0A    public void setup()%7B%0A        //MARCH(3)(10:15)-OCTOBER(2)(19:45)%0A        monthTimeMarch = new MonthTime(MonthDay.of(3, 1), LocalTime.of(10, 15));%0A        monthTimeOctober =  new MonthTime(MonthDay.of(10, 11), LocalTime.of(19, 45));%0A        alarmClock = new AlarmClockMonthTime(monthTimeMarch, monthTimeOctober);%0A        input = LocalDateTime.of(2017, 5, 17, 12, 00);%0A    %7D%0A%0A    @Test%0A    public void secondsLeftWhenStartAndEndInSameYear()%7B%0A        long timeLeft = alarmClock.remainingTime(input).getSeconds();%0A%0A        assertThat(timeLeft, is(12728700L));%0A    %7D%0A%0A    //OCTOBER(2)(10:15)-MARCH(3)(19:45)%0A    @Test%0A    public void secondsLeftWhenEndInYearAfterStart()%7B%0A        AlarmClockMonthTime alarmClockOctToMarch = new AlarmClockMonthTime(monthTimeOctober, monthTimeMarch);%0A        LocalDateTime inputNov = LocalDateTime.of(2017, 11, 17, 12, 00);%0A%0A        long timeLeft = alarmClockOctToMarch.remainingTime(inputNov).getSeconds();%0A%0A        assertThat(timeLeft, is(8979300L));%0A    %7D%0A%0A    @Test%0A    public void noTimeLeftWhenJustBeforeStart()%7B%0A        LocalDateTime inputBeforeStart = LocalDateTime.of(2017, 3, 1, 10, 14);%0A%0A        long timeLeft = alarmClock.remainingTime(inputBeforeStart).getSeconds();%0A%0A        assertThat(timeLeft, is(0L));%0A    %7D%0A%0A    @Test%0A    public void noTimeLeftWhenJustAfterEnd()%7B%0A        LocalDateTime inputAfterEnd = LocalDateTime.of(2017, 10, 11, 19, 46);%0A%0A        long timeLeft = alarmClock.remainingTime(inputAfterEnd).getSeconds();%0A%0A        assertThat(timeLeft, is(0L));%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void exceptionIfEndIsNull()%7B%0A        new AlarmClockMonthTime(monthTimeMarch, null);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void exceptionIfStartIsNull()%7B%0A        new AlarmClockMonthTime(null, monthTimeMarch);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void exceptionIfStartAndEndIsNull()%7B%0A        new AlarmClockMonthTime(null, null);%0A    %7D%0A%7D%0A

Test AlarmClockMonthTimeTest instance.