Search in sources :

Example 21 with On

use of com.cronutils.model.field.expression.On in project cron-utils by jmrozanec.

the class CronMapperTest method testReturnOnZeroExpression.

@Test
public void testReturnOnZeroExpression() {
    final Function<CronField, CronField> function = CronMapper.returnOnZeroExpression(testCronFieldName);
    assertEquals(testCronFieldName, function.apply(mockCronField).getField());
    final On result = (On) function.apply(mockCronField).getExpression();
    assertEquals(0, (int) result.getTime().getValue());
}
Also used : CronField(com.cronutils.model.field.CronField) On(com.cronutils.model.field.expression.On) Test(org.junit.Test)

Aggregations

On (com.cronutils.model.field.expression.On)21 CronField (com.cronutils.model.field.CronField)15 IntegerFieldValue (com.cronutils.model.field.value.IntegerFieldValue)13 Test (org.junit.Test)10 SingleCron (com.cronutils.model.SingleCron)9 ArrayList (java.util.ArrayList)9 SpecialCharFieldValue (com.cronutils.model.field.value.SpecialCharFieldValue)5 Before (org.junit.Before)4 FieldConstraints (com.cronutils.model.field.constraint.FieldConstraints)2 Between (com.cronutils.model.field.expression.Between)2 Every (com.cronutils.model.field.expression.Every)2 Function (com.cronutils.Function)1 WeekDay (com.cronutils.mapper.WeekDay)1 DayOfWeekFieldDefinition (com.cronutils.model.field.definition.DayOfWeekFieldDefinition)1 FieldDefinition (com.cronutils.model.field.definition.FieldDefinition)1 And (com.cronutils.model.field.expression.And)1 FieldExpression (com.cronutils.model.field.expression.FieldExpression)1 MessageFormat (java.text.MessageFormat)1 DayOfWeek (java.time.DayOfWeek)1 Month (java.time.Month)1