@Test public void shouldTranslateStaffId() { EmploymentRecord er = new EmploymentRecord(); er.setSIF_RefId("sifStaffId"); Entity entity = new SimpleEntity("entityType", "staffSliGuid"); Mockito.when(sifIdResolver.getSliEntity(Mockito.anyString(), Mockito.anyString())).thenReturn(entity); List<StaffEducationOrganizationAssociationEntity> result = translator.doTranslate(er, "zone"); Assert.assertNotNull(result); Assert.assertEquals(1, result.size()); StaffEducationOrganizationAssociationEntity e = result.get(0); Assert.assertEquals("staffSliGuid", e.getStaffReference()); }
@Override public List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId) { List<StaffEducationOrganizationAssociationEntity> result = new ArrayList<StaffEducationOrganizationAssociationEntity>(); if (sifData == null) { return result; } sifData.setRefId(sifData.getSIF_RefId() + ":" + sifData.getSIF_RefObject() + ":" + sifData.getLEAInfoRefId()); Entity staff = sifIdResolver.getSliEntity(sifData.getSIF_RefId(), zoneId); Entity edOrg = sifIdResolver.getSliEntity(sifData.getLEAInfoRefId(), zoneId); if (staff == null || edOrg == null) { return result; } StaffEducationOrganizationAssociationEntity e = new StaffEducationOrganizationAssociationEntity(); e.setEducationOrganizationReference(edOrg.getId()); e.setStaffReference(staff.getId()); e.setPositionTitle(sifData.getPositionTitle()); e.setBeginDate(dateConverter.convert(sifData.getHireDate())); e.setEndDate(dateConverter.convert(sifData.getTerminationDate())); e.setStaffClassification("Other"); result.add(e); return result; }
EmploymentRecordToStaffEdOrgTranslationTask extends
        AbstractTranslationTask<EmploymentRecord, StaffEducationOrganizationAssociationEntity> { @Override public List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId) { List<StaffEducationOrganizationAssociationEntity> result = new ArrayList<StaffEducationOrganizationAssociationEntity>(); if (sifData == null) { return result; } sifData.setRefId(sifData.getSIF_RefId() + ":" + sifData.getSIF_RefObject() + ":" + sifData.getLEAInfoRefId()); Entity staff = sifIdResolver.getSliEntity(sifData.getSIF_RefId(), zoneId); Entity edOrg = sifIdResolver.getSliEntity(sifData.getLEAInfoRefId(), zoneId); if (staff == null || edOrg == null) { return result; } StaffEducationOrganizationAssociationEntity e = new StaffEducationOrganizationAssociationEntity(); e.setEducationOrganizationReference(edOrg.getId()); e.setStaffReference(staff.getId()); e.setPositionTitle(sifData.getPositionTitle()); e.setBeginDate(dateConverter.convert(sifData.getHireDate())); e.setEndDate(dateConverter.convert(sifData.getTerminationDate())); e.setStaffClassification("Other"); result.add(e); return result; } }
EmploymentRecordToStaffEdOrgTranslationTask extends
        AbstractTranslationTask<EmploymentRecord, StaffEducationOrganizationAssociationEntity> { @Override public List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId) { List<StaffEducationOrganizationAssociationEntity> result = new ArrayList<StaffEducationOrganizationAssociationEntity>(); if (sifData == null) { return result; } sifData.setRefId(sifData.getSIF_RefId() + ":" + sifData.getSIF_RefObject() + ":" + sifData.getLEAInfoRefId()); Entity staff = sifIdResolver.getSliEntity(sifData.getSIF_RefId(), zoneId); Entity edOrg = sifIdResolver.getSliEntity(sifData.getLEAInfoRefId(), zoneId); if (staff == null || edOrg == null) { return result; } StaffEducationOrganizationAssociationEntity e = new StaffEducationOrganizationAssociationEntity(); e.setEducationOrganizationReference(edOrg.getId()); e.setStaffReference(staff.getId()); e.setPositionTitle(sifData.getPositionTitle()); e.setBeginDate(dateConverter.convert(sifData.getHireDate())); e.setEndDate(dateConverter.convert(sifData.getTerminationDate())); e.setStaffClassification("Other"); result.add(e); return result; } EmploymentRecordToStaffEdOrgTranslationTask(); }
EmploymentRecordToStaffEdOrgTranslationTask extends
        AbstractTranslationTask<EmploymentRecord, StaffEducationOrganizationAssociationEntity> { @Override public List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId) { List<StaffEducationOrganizationAssociationEntity> result = new ArrayList<StaffEducationOrganizationAssociationEntity>(); if (sifData == null) { return result; } sifData.setRefId(sifData.getSIF_RefId() + ":" + sifData.getSIF_RefObject() + ":" + sifData.getLEAInfoRefId()); Entity staff = sifIdResolver.getSliEntity(sifData.getSIF_RefId(), zoneId); Entity edOrg = sifIdResolver.getSliEntity(sifData.getLEAInfoRefId(), zoneId); if (staff == null || edOrg == null) { return result; } StaffEducationOrganizationAssociationEntity e = new StaffEducationOrganizationAssociationEntity(); e.setEducationOrganizationReference(edOrg.getId()); e.setStaffReference(staff.getId()); e.setPositionTitle(sifData.getPositionTitle()); e.setBeginDate(dateConverter.convert(sifData.getHireDate())); e.setEndDate(dateConverter.convert(sifData.getTerminationDate())); e.setStaffClassification("Other"); result.add(e); return result; } EmploymentRecordToStaffEdOrgTranslationTask(); @Override List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId); }
EmploymentRecordToStaffEdOrgTranslationTask extends
        AbstractTranslationTask<EmploymentRecord, StaffEducationOrganizationAssociationEntity> { @Override public List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId) { List<StaffEducationOrganizationAssociationEntity> result = new ArrayList<StaffEducationOrganizationAssociationEntity>(); if (sifData == null) { return result; } sifData.setRefId(sifData.getSIF_RefId() + ":" + sifData.getSIF_RefObject() + ":" + sifData.getLEAInfoRefId()); Entity staff = sifIdResolver.getSliEntity(sifData.getSIF_RefId(), zoneId); Entity edOrg = sifIdResolver.getSliEntity(sifData.getLEAInfoRefId(), zoneId); if (staff == null || edOrg == null) { return result; } StaffEducationOrganizationAssociationEntity e = new StaffEducationOrganizationAssociationEntity(); e.setEducationOrganizationReference(edOrg.getId()); e.setStaffReference(staff.getId()); e.setPositionTitle(sifData.getPositionTitle()); e.setBeginDate(dateConverter.convert(sifData.getHireDate())); e.setEndDate(dateConverter.convert(sifData.getTerminationDate())); e.setStaffClassification("Other"); result.add(e); return result; } EmploymentRecordToStaffEdOrgTranslationTask(); @Override List<StaffEducationOrganizationAssociationEntity> doTranslate(EmploymentRecord sifData, String zoneId);  }