Skip to content

Commit

Permalink
Issue #308: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrozanec committed Mar 14, 2018
1 parent b82dbbb commit 11d9c35
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/cronutils/model/CronTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
import java.io.ObjectOutputStream;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import com.cronutils.descriptor.CronDescriptor;
import com.cronutils.mapper.CronMapper;
import com.cronutils.model.definition.CronDefinition;
import com.cronutils.model.definition.CronDefinitionBuilder;
Expand All @@ -39,6 +41,7 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -181,4 +184,16 @@ public void testAsScheduleExpressionDoYNotSupported() {
final Cron cron = cronParser.parse("0 0 0 1 1-3 * * 1/14");
CronUtils.asScheduleExpression(cron);
}

//@Test TODO
public void testIssue308(){
CronDefinition cronDefinition = CronDefinitionBuilder.instanceDefinitionFor( CronType.QUARTZ );
CronParser parser = new CronParser( cronDefinition );
Cron quartzCron = parser.parse( "0 0 11 L-2 * ?" );
CronDescriptor descriptor = CronDescriptor.instance(Locale.ENGLISH);
String description = descriptor.describe(quartzCron);

// not sure what the exact string 'should' be ..
assertEquals( "at 11:00 two days before the last day of month", description);
}
}

0 comments on commit 11d9c35

Please sign in to comment.