@Test
public void parseDeliveryReportMissingTicket() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"deliveryReport\">\n")
        .append(" <account username=\"customer1\" password=\"test1\"/>\n")
        .append(" <deliveryReportRequest>\n")
        .append("   <status code=\"5\" message=\"Expired\"/>\n")
        //.append("   <ticketId>000:20090118002220948:000</ticketId>\n")
        .append(" </deliveryReportRequest>\n")
        .append("</operation>\n")
        .append("");
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
    SxmpParser parser = new SxmpParser();
    try {
        Operation operation = parser.parse(is);
        Assert.fail();
    } catch (SxmpParsingException e) {
         // correct behavior
        Assert.assertEquals(SxmpErrorCode.MISSING_REQUIRED_ELEMENT, e.getErrorCode());
        Assert.assertThat(e.getMessage(), CoreMatchers.containsString("A ticketId value is mandatory with a deliveryReportRequest"));
        Assert.assertNotNull(e.getOperation());
        DeliveryReportRequest deliveryRequest = (DeliveryReportRequest)e.getOperation();
        Assert.assertEquals(Operation.Type.DELIVERY_REPORT, deliveryRequest.getType());
    }
}