### Question:
EventReporter implements Publisher { public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChanged(); employeePersonal.setOtherIdList(new HrOtherIdList(new OtherId(OtherIdType.CERTIFICATE, "certificate"))); } Event event = new Event(employeePersonal, action); zone.reportEvent(event); return event; } EventReporter(Zone zone); static void main(String[] args); List<Event> runReportScript(String script, long waitTime); Event reportLeaInfoEvent(EventAction action); Event reportSchoolInfoEvent(EventAction action); Event reportStudentPersonalEvent(EventAction action); Event reportStudentLeaRelationshipEvent(EventAction action); Event reportStudentSchoolEnrollmentEvent(EventAction action); Event reportStaffPersonalEvent(EventAction action); Event reportEmployeePersonalEvent(EventAction action); Event reportStaffAssignmentEvent(EventAction action); Event reportEmploymentRecordEvent(EventAction action); Event reportEmployeeAssignmentEvent(EventAction action); Event reportEvent(String messageFile, String eventAction); @Override void onRequest(DataObjectOutputStream out, Query query, Zone zone, MessageInfo info); static final Logger LOG; }### Answer:
@Test public void runReportEmployeePersonalEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = EmployeePersonal.class; String expectedId = SifEntityGenerator.TEST_EMPLOYEEPERSONAL_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportEmployeePersonalEvent(eventAction); EmployeePersonal dataObject = (EmployeePersonal) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, false); OtherId otherId = dataObject.getOtherIdList().get(0); Assert.assertEquals(OtherIdType.SOCIALSECURITY.getValue(), otherId.getType()); Assert.assertEquals("333333333", otherId.getValue()); eventAction = EventAction.CHANGE; sentEvent = eventReporter.reportEmployeePersonalEvent(eventAction); dataObject = (EmployeePersonal) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, true); otherId = dataObject.getOtherIdList().get(0); Assert.assertEquals(OtherIdType.CERTIFICATE.getValue(), otherId.getType()); Assert.assertEquals("certificate", otherId.getValue()); eventAction = EventAction.DELETE; sentEvent = eventReporter.reportEmployeePersonalEvent(eventAction); dataObject = (EmployeePersonal) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, false); otherId = dataObject.getOtherIdList().get(0); Assert.assertEquals(OtherIdType.SOCIALSECURITY.getValue(), otherId.getType()); Assert.assertEquals("333333333", otherId.getValue()); }