@Test
public void doProcessDeliverWithUnsupportedSxmpErrorThrown() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"deliver\">\n")
        .append(" <account username=\"customer1\" password=\"test1\"/>\n")
        .append(" <deliverRequest referenceId=\"MYREF102020022\">\n")
        .append("  <operatorId>10</operatorId>\n")
        .append("  <sourceAddress type=\"network\">40404</sourceAddress>\n")
        .append("  <destinationAddress type=\"international\">+12065551212</destinationAddress>\n")
        .append("  <text encoding=\"ISO-8859-1\">48656c6c6f20576f726c64</text>\n")
        .append(" </deliverRequest>\n")
        .append("</operation>\n")
        .append("");
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes());
    StringWriter sw = new StringWriter();
    SxmpProcessor requestProcessor = new SxmpProcessor() {
        public boolean authenticate(Account account) throws SxmpErrorException {
            return true;
        }
        public SubmitResponse submit(Account account, SubmitRequest submitReq) throws SxmpErrorException {
            throw new SxmpErrorException(SxmpErrorCode.INVALID_VALUE, "Short code not allowed");
        }
        public DeliverResponse deliver(Account account, DeliverRequest deliverRequest) throws SxmpErrorException {
            throw new SxmpErrorException(SxmpErrorCode.INVALID_VALUE, "Short code not allowed");
        }
        public DeliveryReportResponse deliveryReport(Account account, DeliveryReportRequest deliveryRequest) throws SxmpErrorException {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    };
    new SxmpServletProcessor().doProcess(requestProcessor, is, new PrintWriter(sw), "/1.0", "POST", "text/xml; charset=ISO-8859-1");
    // actual deliver request from Verizon
    StringBuilder expectedXML = new StringBuilder(200)
        .append("<?xml version=\"1.0\" encoding=\"utf-8\"?><operation type=\"deliver\"><error code=\"1006\" message=\"Short code not allowed\"/></operation>");
    XMLUnit.setIgnoreWhitespace(true);
    Diff myDiff = new Diff(expectedXML.toString(), sw.toString());
    DetailedDiff myDetailedDiff = new DetailedDiff(myDiff);
    Assert.assertTrue("Deliver XML are similar " + myDetailedDiff, myDetailedDiff.similar());
}