1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

Merge pull request #630 from guusdk/sint_formtest-smack-4.5.0-beta2

[sint] Fix compatibility with Smack 4.5.0-beta2
This commit is contained in:
Florian Schmaus 2024-09-25 10:59:09 +00:00 committed by GitHub
commit 348a3ab091
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,22 +128,22 @@ public class FormTest extends AbstractSmackIntegrationTest {
completedForm.setAnswer("time", true); completedForm.setAnswer("time", true);
completedForm.setAnswer("age", 20); completedForm.setAnswer("age", 20);
// Create a new message to send with the completed form // Create a new message to send with the completed form
msg2 = StanzaBuilder.buildMessage() Message msg3 = StanzaBuilder.buildMessage()
.to(conOne.getUser().asBareJid()) .to(conOne.getUser().asBareJid())
.setThread(msg.getThread()) .setThread(msg2.getThread())
.ofType(Message.Type.chat) .ofType(Message.Type.chat)
.setBody("To enter a case please fill out this form and send it back to me") .setBody("To enter a case please fill out this form and send it back to me")
// Add the completed form to the message // Add the completed form to the message
.addExtension(completedForm.getDataFormToSubmit()) .addExtension(completedForm.getDataFormToSubmit())
.build(); .build();
// Send the message with the completed form // Send the message with the completed form
conTwo.sendStanza(msg2); conTwo.sendStanza(msg3);
// Get the message with the completed form // Get the message with the completed form
Message msg3 = collector.nextResult(); Message msg4 = collector.nextResult();
assertNotNull(msg3, "Message not found"); assertNotNull(msg4, "Message not found");
// Retrieve the completed form // Retrieve the completed form
final DataForm completedForm2 = DataForm.from(msg3); final DataForm completedForm2 = DataForm.from(msg4);
assertNotNull(completedForm2); assertNotNull(completedForm2);
assertNotNull(completedForm2.getField("name")); assertNotNull(completedForm2.getField("name"));
assertNotNull(completedForm2.getField("description")); assertNotNull(completedForm2.getField("description"));