@Test public void should_map_on_entity() throws Exception { JobFormEntity formEntity = formFactory.givenNewJobFormEntity(); JobForm form = formFactory.givenJobFormBuilderWithValues() .withStartDate(null) .build(); mapperUnderTest.mapFormOnEntity(form, formEntity); JobSimpleTriggerEntity simpleTrigger = formEntity.getSimpleTrigger(); assertThat(simpleTrigger.getOccurrenceCount(), is(1)); assertThat(simpleTrigger.getRecurrenceInterval(), is(1)); assertThat(simpleTrigger.getRecurrenceIntervalUnit(), is("DAY")); assertThat(simpleTrigger.getTimezone(), is(formFactory.provideTimeZone().getID())); assertThat(simpleTrigger.getStartType(), is(1)); }
@Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"); entity.setSimpleTrigger(triggerEntity); }
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"); entity.setSimpleTrigger(triggerEntity); } }
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"); entity.setSimpleTrigger(triggerEntity); }  }
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"); entity.setSimpleTrigger(triggerEntity); }  @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity); }
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"); entity.setSimpleTrigger(triggerEntity); }  @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity);  }