Skip to content

Commit d30c5e3

Browse files
committed
Enable unit tests for #430 and #462 Both have been fixed in the main code
1 parent 5321c76 commit d30c5e3

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/test/java/com/cronutils/Issue430Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.time.ZoneOffset;
1414
import java.time.ZonedDateTime;
1515

16-
@Ignore
1716
public class Issue430Test {
1817
@Test
1918
public void test() {
@@ -22,7 +21,8 @@ public void test() {
2221
Cron cron = parser.parse("0 0 12 30 6 ? 2020/10");
2322
ExecutionTime execution = ExecutionTime.forCron(cron);
2423
ZonedDateTime dateTime = ZonedDateTime.of(2020, 6, 30, 12, 0, 0, 0, ZoneOffset.UTC);
25-
Assert.assertEquals(dateTime.minusYears(10), execution.lastExecution(dateTime).orElse(null));
24+
// The cron starts from 2020, so no last execution date should be returned.
25+
Assert.assertNull(execution.lastExecution(dateTime).orElse(null));
2626
Assert.assertEquals(dateTime.plusYears(10), execution.nextExecution(dateTime).orElse(null));
2727
}
2828
}

src/test/java/com/cronutils/Issue462Test.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,21 @@ public void setUp() {
4242
/**
4343
* Faulty describe that includes a proposal for the fixed output.
4444
*/
45-
@Ignore
4645
@Test
47-
public void testCaseEverySecondOnEvery30Minutes() throws ParseException {
46+
public void testCaseEverySecondOnEvery30Minutes() {
4847
final String cronExpression = "* /30 * * * *";
4948
final Cron cron = parser.parse(cronExpression);
5049
// create the *** BY NOW ** wrong describe
5150
final String describe = descriptor.describe(cron);
5251
// ** will fail by now ** this is a just proposal how the describe may look like
53-
assertEquals("every second, every 30 minutes", describe);
54-
// this will pass by now but should ** NOT **
55-
// assertEquals("every 30 minutes", describe);
52+
assertEquals("every second every 30 minutes", describe);
5653
}
5754

5855
/**
5956
* Correct describe for showing that the same output is generated.
6057
*/
6158
@Test
62-
public void testCaseOnceEvery30Minutes() throws ParseException {
59+
public void testCaseOnceEvery30Minutes() {
6360
final String cronExpression = "0 /30 * * * *";
6461
final Cron cron = parser.parse(cronExpression);
6562
// create the correct describe

0 commit comments

Comments
 (0)