Stanza stanza = XMPPCoreStanza.getWrapper(StanzaBuilder.createMessageStanza(FROM, TO, LANG, BODY).build());
strategy.process(stanza, Arrays.asList((DeliveryException)new RemoteServerNotFoundException(ERROR_TEXT)));
Iterator<Triple> triples = relay.iterator();
Triple triple = triples.next();
Assert.assertEquals(FROM, triple.getEntity());
MessageStanza errorStanza = (MessageStanza) XMPPCoreStanza.getWrapper(triple.getStanza());
Assert.assertEquals("error", errorStanza.getType());
Assert.assertEquals(FROM, errorStanza.getTo());
Assert.assertEquals(SERVER, errorStanza.getFrom());
XMLElement errorElm = errorStanza.getSingleInnerElementsNamed("error", NamespaceURIs.JABBER_CLIENT);
Assert.assertEquals("cancel", errorElm.getAttributeValue("type"));
Assert.assertNotNull(errorElm.getSingleInnerElementsNamed("remote-server-not-found", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS));
XMLElement textElm = errorElm.getSingleInnerElementsNamed("text", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS);
Assert.assertEquals(ERROR_TEXT, textElm.getInnerText().getText());
Assert.assertEquals(IgnoreFailureStrategy.IGNORE_FAILURE_STRATEGY, triple.getDeliveryFailureStrategy());
Assert.assertFalse(triples.hasNext());
}