@Test public void should_map_none_entity_trigger_to_form() throws Exception { givenEntityFormWithNoneTrigger(); whenMapsEntityToForm(); verify(mNoneTriggerMapper).mapEntityOnForm(formBuilder, providedFormEntity); }
@Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String recurrenceIntervalUnit = simpleTrigger.getRecurrenceIntervalUnit(); boolean triggerIsSimpleType = (recurrenceInterval != null && recurrenceIntervalUnit != null); if (triggerIsSimpleType) { mSimpleTriggerMapper.mapEntityOnForm(form, entity); } else { mNoneTriggerMapper.mapEntityOnForm(form, entity); } } }
JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String recurrenceIntervalUnit = simpleTrigger.getRecurrenceIntervalUnit(); boolean triggerIsSimpleType = (recurrenceInterval != null && recurrenceIntervalUnit != null); if (triggerIsSimpleType) { mSimpleTriggerMapper.mapEntityOnForm(form, entity); } else { mNoneTriggerMapper.mapEntityOnForm(form, entity); } } } }
JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String recurrenceIntervalUnit = simpleTrigger.getRecurrenceIntervalUnit(); boolean triggerIsSimpleType = (recurrenceInterval != null && recurrenceIntervalUnit != null); if (triggerIsSimpleType) { mSimpleTriggerMapper.mapEntityOnForm(form, entity); } else { mNoneTriggerMapper.mapEntityOnForm(form, entity); } } } JobTriggerMapper(
            JobCalendarTriggerMapper calendarTriggerMapper,
            JobSimpleTriggerMapper simpleTriggerMapper,
            JobNoneTriggerMapper noneTriggerMapper
    ); }
JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String recurrenceIntervalUnit = simpleTrigger.getRecurrenceIntervalUnit(); boolean triggerIsSimpleType = (recurrenceInterval != null && recurrenceIntervalUnit != null); if (triggerIsSimpleType) { mSimpleTriggerMapper.mapEntityOnForm(form, entity); } else { mNoneTriggerMapper.mapEntityOnForm(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 mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String recurrenceIntervalUnit = simpleTrigger.getRecurrenceIntervalUnit(); boolean triggerIsSimpleType = (recurrenceInterval != null && recurrenceIntervalUnit != null); if (triggerIsSimpleType) { mSimpleTriggerMapper.mapEntityOnForm(form, entity); } else { mNoneTriggerMapper.mapEntityOnForm(form, entity); } } } JobTriggerMapper(
            JobCalendarTriggerMapper calendarTriggerMapper,
            JobSimpleTriggerMapper simpleTriggerMapper,
            JobNoneTriggerMapper noneTriggerMapper
    ); @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity);  }