EDXLDistributionEventDescriptionBuilder extends TargetEventDescriptionBuilder { @Override public void setArguments(Object... arguements) { extractAssertion(arguements); extractAlertMessage(arguements); extractTarget(arguements); }  @Override void buildTimeStamp(); @Override void buildStatuses(); @Override void buildPayloadTypes(); @Override void buildPayloadSizes(); @Override void buildErrorCodes(); @Override void setArguments(Object... arguements); @Override void setReturnValue(Object returnValue);  }
@Test public void handlesAssertionCorrectly() { assertTrue( AssertionEventDescriptionBuilder.class.isAssignableFrom(EDXLDistributionEventDescriptionBuilder.class)); builder.setArguments(mock(AssertionType.class)); assertTrue(builder.getAssertion().isPresent()); }
@Test public void handlesEmptyArguments() { builder.setArguments((Object[]) null); }
@Test public void extractsTimestamp() { EDXLDistribution edxl = new EDXLDistribution(); XMLGregorianCalendar value = mock(XMLGregorianCalendar.class); when(value.toString()).thenReturn("foo"); edxl.setDateTimeSent(value); builder.setArguments(edxl); EventDescription eventDescription = getEventDescription(builder); assertEquals("foo", eventDescription.getTimeStamp()); }
@Test public void extractsStatus() { EDXLDistribution edxl = new EDXLDistribution(); builder.setArguments(edxl); StatusValues statusValue = StatusValues.ACTUAL; edxl.setDistributionStatus(statusValue); EventDescription eventDescription = getEventDescription(builder); assertEquals(1, eventDescription.getStatuses().size()); assertEquals(statusValue.toString(), eventDescription.getStatuses().get(0)); }