@Test public void should_map_simple_trigger_to_entity() throws Exception { givenFormWithSimpleTrigger(); whenMapsFormToEntity(); verify(mSimpleTriggerMapper).mapFormOnEntity(providedForm, mappedFormEntity); }
@Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFormOnEntity(form, entity); } else { mSimpleTriggerMapper.mapFormOnEntity(form, entity); } } }
JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFormOnEntity(form, entity); } else { mSimpleTriggerMapper.mapFormOnEntity(form, entity); } } } }
JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFormOnEntity(form, entity); } else { mSimpleTriggerMapper.mapFormOnEntity(form, entity); } } } JobTriggerMapper(
            JobCalendarTriggerMapper calendarTriggerMapper,
            JobSimpleTriggerMapper simpleTriggerMapper,
            JobNoneTriggerMapper noneTriggerMapper
    ); }
JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFormOnEntity(form, entity); } else { mSimpleTriggerMapper.mapFormOnEntity(form, entity); } } } JobTriggerMapper(
            JobCalendarTriggerMapper calendarTriggerMapper,
            JobSimpleTriggerMapper simpleTriggerMapper,
            JobNoneTriggerMapper noneTriggerMapper
    ); @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity); }
JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFormOnEntity(form, entity); } else { mSimpleTriggerMapper.mapFormOnEntity(form, entity); } } } JobTriggerMapper(
            JobCalendarTriggerMapper calendarTriggerMapper,
            JobSimpleTriggerMapper simpleTriggerMapper,
            JobNoneTriggerMapper noneTriggerMapper
    ); @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity);  }