Search in sources :

Example 6 with OriginIdElement

use of org.jivesoftware.smackx.sid.element.OriginIdElement in project Smack by igniterealtime.

the class RetractedElementTest method serializationTest.

@Test
public void serializationTest() throws ParseException {
    Date stamp = XmppDateTime.parseXEP0082Date("2019-09-20T23:08:25.000+00:00");
    OriginIdElement originId = new OriginIdElement("origin-id-1");
    RetractedElement retractedElement = new RetractedElement(stamp, originId);
    String expectedXml = "" + "<retracted stamp='2019-09-20T23:08:25.000+00:00' xmlns='urn:xmpp:message-retract:0'>\n" + "  <origin-id xmlns='urn:xmpp:sid:0' id='origin-id-1'/>\n" + "</retracted>";
    assertXmlSimilar(expectedXml, retractedElement.toXML());
}
Also used : OriginIdElement(org.jivesoftware.smackx.sid.element.OriginIdElement) Date(java.util.Date) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

OriginIdElement (org.jivesoftware.smackx.sid.element.OriginIdElement)6 Test (org.junit.jupiter.api.Test)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 Date (java.util.Date)2 FasteningElement (org.jivesoftware.smackx.message_fastening.element.FasteningElement)2 XmlPullParser (org.jivesoftware.smack.xml.XmlPullParser)1 ExternalElement (org.jivesoftware.smackx.message_fastening.element.ExternalElement)1 RetractedElement (org.jivesoftware.smackx.message_retraction.element.RetractedElement)1 EnumSource (org.junit.jupiter.params.provider.EnumSource)1