use of org.jivesoftware.smack.packet.StanzaError in project Smack by igniterealtime.
the class FailureTest method withStanzaErrrorFailureTest.
@Test
public void withStanzaErrrorFailureTest() throws SAXException, IOException {
StanzaError stanzaError = StanzaError.getBuilder().setCondition(Condition.bad_request).build();
Failure failure = new Failure(Failure.CompressFailureError.setup_failed, stanzaError);
CharSequence xml = failure.toXML();
final String expectedXml = "<failure xmlns='http://jabber.org/protocol/compress'>" + "<setup-failed/>" + "<error xmlns='jabber:client' type='modify'>" + "<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" + "</error>" + "</failure>";
assertXmlSimilar(expectedXml, xml.toString());
}
Aggregations