diff options
author | Alan Young <consult.awy@gmail.com> | 2015-03-03 14:13:49 (GMT) |
---|---|---|
committer | Alan Young <consult.awy@gmail.com> | 2015-04-10 06:52:20 (GMT) |
commit | 87153e86a3340d3ace31efb4330e60cc937d34f2 (patch) | |
tree | af2371404693900d179f785c6038a4668258d3c0 /test/com/isode | |
parent | f78677be53af975b22fadaad92eafd43abc18f1d (diff) | |
download | stroke-87153e86a3340d3ace31efb4330e60cc937d34f2.zip stroke-87153e86a3340d3ace31efb4330e60cc937d34f2.tar.bz2 |
Throw exception for missing payload serializer.
Change-Id: I3578fa59bfcb45f5893a16fa2d45c9ea460be198
Diffstat (limited to 'test/com/isode')
-rw-r--r-- | test/com/isode/stroke/serializer/payloadserializers/ForwardedSerializerTest.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/com/isode/stroke/serializer/payloadserializers/ForwardedSerializerTest.java b/test/com/isode/stroke/serializer/payloadserializers/ForwardedSerializerTest.java index 281be2e..5be9316 100644 --- a/test/com/isode/stroke/serializer/payloadserializers/ForwardedSerializerTest.java +++ b/test/com/isode/stroke/serializer/payloadserializers/ForwardedSerializerTest.java @@ -1,16 +1,12 @@ /* -* Copyright (c) 2014 Kevin Smith and Remko Tronçon -* All rights reserved. -*/ - -/* -* Copyright (c) 2014, Isode Limited, London, England. +* Copyright (c) 2014-2015, Isode Limited, London, England. * All rights reserved. */ package com.isode.stroke.serializer.payloadserializers; import org.junit.Test; + import com.isode.stroke.base.DateTime; import com.isode.stroke.elements.Delay; import com.isode.stroke.elements.Forwarded; @@ -18,7 +14,9 @@ import com.isode.stroke.elements.IQ; import com.isode.stroke.elements.Message; import com.isode.stroke.elements.Payload; import com.isode.stroke.elements.Presence; +import com.isode.stroke.elements.Subject; import com.isode.stroke.jid.JID; + import static org.junit.Assert.assertEquals; public class ForwardedSerializerTest { @@ -27,7 +25,7 @@ public class ForwardedSerializerTest { public void testSerializeIQ() { ForwardedSerializer serializer = new ForwardedSerializer(serializers_); - IQ iq = IQ.createResult(JID.fromString("juliet@capulet.lit/balcony"), JID.fromString("romeo@montague.lit/orchard"), "id0", new Payload()); + IQ iq = IQ.createResult(JID.fromString("juliet@capulet.lit/balcony"), JID.fromString("romeo@montague.lit/orchard"), "id0", new Subject("text")); Forwarded forwarded = new Forwarded(); forwarded.setStanza(iq); @@ -36,7 +34,7 @@ public class ForwardedSerializerTest { String expectedResult = "<forwarded xmlns=\"urn:xmpp:forward:0\">" + "<delay stamp=\"2010-07-10T23:08:25Z\" xmlns=\"urn:xmpp:delay\"/>" - + "<iq from=\"romeo@montague.lit/orchard\" id=\"id0\" to=\"juliet@capulet.lit/balcony\" type=\"result\"/>" + + "<iq from=\"romeo@montague.lit/orchard\" id=\"id0\" to=\"juliet@capulet.lit/balcony\" type=\"result\"><subject>text</subject></iq>" + "</forwarded>"; assertEquals(expectedResult, serializer.serialize(forwarded)); |