PRPAIN201306UV02EventDescriptionBuilder extends TargetEventDescriptionBuilder { @Override public void setReturnValue(Object returnValue) { if (returnValue == null || !(returnValue instanceof PRPAIN201306UV02)) { body = Optional.absent(); } else { body = Optional.of((PRPAIN201306UV02) returnValue); } }  @Override void buildErrorCodes(); @Override void buildPayloadSizes(); @Override void buildPayloadTypes(); @Override void buildRespondingHCIDs(); @Override void buildStatuses(); @Override void buildTimeStamp(); @Override void setArguments(Object... arguments); @Override void setReturnValue(Object returnValue);  }
@Test public void basicStatus() { addAcknowledgements(1, createDetail("Test Content")); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(1, eventDescription.getStatuses().size()); assertEquals("Test Content", eventDescription.getStatuses().get(0)); }
@Test public void twoAcknowledgements() { addAcknowledgements(2, createDetail("Test Content")); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(1, eventDescription.getStatuses().size()); assertTrue(eventDescription.getStatuses().contains("Test Content")); }
@Test public void multipleDetailsInAcknowledgement() { addAcknowledgements(1, createDetail("Test Content"), createDetail("Test Content2")); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(2, eventDescription.getStatuses().size()); assertTrue(eventDescription.getStatuses().contains("Test Content")); assertTrue(eventDescription.getStatuses().contains("Test Content2")); }
@Test public void base64StatusContent() { addAcknowledgements(1, createDetail(BinaryDataEncoding.B_64, "Test Content")); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(1, eventDescription.getStatuses().size()); assertEquals("Test Content", eventDescription.getStatuses().get(0)); }
@Test public void nullFlavoredStatus() { MCCIMT000300UV01AcknowledgementDetail detail = new MCCIMT000300UV01AcknowledgementDetail(); detail.getNullFlavor().add("NI"); addAcknowledgements(1, detail); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(0, eventDescription.getStatuses().size()); }
@Test public void missingSerializedContent() { addAcknowledgements(1, createDetail(BinaryDataEncoding.TXT, null)); PRPAIN201306UV02EventDescriptionBuilder builder = new PRPAIN201306UV02EventDescriptionBuilder(); builder.setReturnValue(body); EventDescription eventDescription = getEventDescription(builder); assertEquals(0, eventDescription.getStatuses().size()); }