### Question:
EventReporter implements Publisher { public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); staffAssignment.setPrimaryAssignment(YesNo.NO); } Event event = new Event(staffAssignment, 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 runReportStaffAssignmentEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StaffAssignment.class; String expectedId = SifEntityGenerator.TEST_STAFFASSIGNMENT_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportStaffAssignmentEvent(eventAction); StaffAssignment dataObject = (StaffAssignment) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, false); Assert.assertEquals(YesNo.YES.getValue(), dataObject.getPrimaryAssignment()); eventAction = EventAction.CHANGE; sentEvent = eventReporter.reportStaffAssignmentEvent(eventAction); dataObject = (StaffAssignment) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, true); Assert.assertEquals(YesNo.NO.getValue(), dataObject.getPrimaryAssignment()); eventAction = EventAction.DELETE; sentEvent = eventReporter.reportStaffAssignmentEvent(eventAction); dataObject = (StaffAssignment) runDataObjectEventTest(sentEvent, eventAction, expectedClass, expectedId, false); Assert.assertEquals(YesNo.YES.getValue(), dataObject.getPrimaryAssignment()); }