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

[test] Use correct class StanzaBuilder for static call to buildMessage()

This commit is contained in:
Florian Schmaus 2020-05-21 22:44:51 +02:00
parent c4ad857c0d
commit ca85b8326a
2 changed files with 6 additions and 5 deletions

View file

@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.MessageBuilder;
import org.jivesoftware.smack.packet.StanzaBuilder;
import org.jivesoftware.smackx.fallback_indication.element.FallbackIndicationElement;
@ -30,11 +30,11 @@ public class FallbackIndicationTest {
@Test
public void testFallbackIndicationElementFromMessageTest() {
Message messageWithoutFallback = MessageBuilder.buildMessage()
Message messageWithoutFallback = StanzaBuilder.buildMessage()
.build();
assertNull(FallbackIndicationElement.fromMessage(messageWithoutFallback));
Message messageWithFallback = MessageBuilder.buildMessage()
Message messageWithFallback = StanzaBuilder.buildMessage()
.addExtension(new FallbackIndicationElement())
.build();
assertNotNull(FallbackIndicationElement.fromMessage(messageWithFallback));

View file

@ -29,6 +29,7 @@ import java.util.Arrays;
import org.jivesoftware.smack.packet.MessageBuilder;
import org.jivesoftware.smack.packet.StandardExtensionElement;
import org.jivesoftware.smack.packet.StanzaBuilder;
import org.jivesoftware.smack.packet.StanzaFactory;
import org.jivesoftware.smack.packet.id.StandardStanzaIdSource;
import org.jivesoftware.smack.parsing.SmackParsingException;
@ -166,10 +167,10 @@ public class MessageFasteningElementsTest {
@Test
public void hasFasteningElementTest() {
MessageBuilder messageBuilderWithFasteningElement = MessageBuilder.buildMessage()
MessageBuilder messageBuilderWithFasteningElement = StanzaBuilder.buildMessage()
.setBody("Hi!")
.addExtension(FasteningElement.builder().setOriginId("origin-id-1").build());
MessageBuilder messageBuilderWithoutFasteningElement = MessageBuilder.buildMessage()
MessageBuilder messageBuilderWithoutFasteningElement = StanzaBuilder.buildMessage()
.setBody("Ho!");
assertTrue(FasteningElement.hasFasteningElement(messageBuilderWithFasteningElement));