@@ -0,0 +1,2318 @@
+/**%0D%0A * %0D%0A */%0D%0Apackage com.cronutils;%0D%0A%0D%0Aimport static org.junit.Assert.*;%0D%0A%0D%0Aimport java.time.LocalDateTime;%0D%0Aimport java.time.ZoneId;%0D%0Aimport java.time.ZonedDateTime;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport com.cronutils.model.Cron;%0D%0Aimport com.cronutils.model.CronType;%0D%0Aimport com.cronutils.model.definition.CronDefinitionBuilder;%0D%0Aimport com.cronutils.model.time.ExecutionTime;%0D%0Aimport com.cronutils.parser.CronParser;%0D%0Aimport com.google.common.base.Optional;%0D%0A%0D%0Apublic class Issue215Test %7B%0D%0A%0D%0A    // test f%C3%BCr https://github.com/jmrozanec/cron-utils/issues/215%0D%0A    @Test%0D%0A    public void testWorkdayBugWithNextMonth() %7B%0D%0A%0D%0A        testWorkdays8( LocalDateTime.of( 2017, 7, 7, 10, 00 ), LocalDateTime.of( 2017, 7, 10, 8, 00 ) ); //good%0D%0A        testWorkdays8( LocalDateTime.of( 2017, 8, 31, 10, 00 ), LocalDateTime.of( 2017, 9, 1, 8, 00 ) ); //good%0D%0A        testWorkdays8( LocalDateTime.of( 2017, 6, 30, 10, 00 ), LocalDateTime.of( 2017, 7, 3, 8, 00 ) ); //not good%0D%0A        testWorkdays8( LocalDateTime.of( 2017, 9, 29, 10, 00 ), LocalDateTime.of( 2017, 10, 2, 8, 00 ) ); //not good%0D%0A    %7D%0D%0A%0D%0A    private void testWorkdays8( LocalDateTime startDate, LocalDateTime expectedNextExecution ) %7B%0D%0A        CronParser parser = new CronParser( CronDefinitionBuilder.instanceDefinitionFor( CronType.QUARTZ ) );%0D%0A        Cron quartzCron = parser.parse( %220 0 8 ? * MON-FRI%22 );%0D%0A        ExecutionTime executionTime = ExecutionTime.forCron( quartzCron );%0D%0A        ZonedDateTime zonedDateTime = ZonedDateTime.of( startDate, ZoneId.systemDefault() );%0D%0A        org.threeten.bp.ZonedDateTime xx = timeToThreeten( zonedDateTime );%0D%0A        Optional%3Corg.threeten.bp.ZonedDateTime%3E next = executionTime.nextExecution( xx );%0D%0A        assertEquals( timeToThreeten( ZonedDateTime.of( expectedNextExecution, ZoneId.systemDefault() ) ), next.get() );%0D%0A    %7D%0D%0A%0D%0A    private org.threeten.bp.ZonedDateTime timeToThreeten( ZonedDateTime zonedDateTime ) %7B%0D%0A        org.threeten.bp.ZonedDateTime xx =%0D%0A                        org.threeten.bp.ZonedDateTime.of( zonedDateTime.getYear(), zonedDateTime.getMonthValue(), zonedDateTime.getDayOfMonth(), zonedDateTime.getHour(), zonedDateTime.getMinute(), zonedDateTime.getSecond(), zonedDateTime.getNano(), org.threeten.bp.ZoneId.of( zonedDateTime.getZone().getId() ) );%0D%0A        return xx;%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

test for issue https://github.com/jmrozanec/cron-utils/issues/215