1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

Deprecate Forwarded.getForwardedPacket()

This commit is contained in:
Florian Schmaus 2015-06-02 17:30:23 +02:00
parent 9a00e09c0a
commit 1cd268a8f0
3 changed files with 14 additions and 3 deletions

View file

@ -64,7 +64,7 @@ public class CarbonTest extends ExperimentalInitializerTest {
assertEquals(null, fwd.getDelayInformation());
// check message
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedPacket().getFrom()));
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedStanza().getFrom()));
// check end of tag
assertEquals(XmlPullParser.END_TAG, parser.getEventType());

View file

@ -78,11 +78,22 @@ public class Forwarded implements ExtensionElement {
* get the stanza(/packet) forwarded by this stanza.
*
* @return the {@link Stanza} instance (typically a message) that was forwarded.
* @deprecated use @{link {@link #getForwardedStanza()}} instead.
*/
@Deprecated
public Stanza getForwardedPacket() {
return forwardedPacket;
}
/**
* Get the forwarded Stanza found in this extension.
*
* @return the {@link Stanza} (typically a message) that was forwarded.
*/
public Stanza getForwardedStanza() {
return forwardedPacket;
}
/**
* get the timestamp of the forwarded packet.
*

View file

@ -58,7 +58,7 @@ public class ForwardedTest {
assertEquals(null, fwd.getDelayInformation());
// check message
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedPacket().getFrom()));
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedStanza().getFrom()));
// check end of tag
assertEquals(XmlPullParser.END_TAG, parser.getEventType());
@ -86,7 +86,7 @@ public class ForwardedTest {
assertNotNull(delay);
// check message
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedPacket().getFrom()));
assertThat("romeo@montague.com", equalsCharSequence(fwd.getForwardedStanza().getFrom()));
// check end of tag
assertEquals(XmlPullParser.END_TAG, parser.getEventType());