Skip to content

Commit

Permalink
[sint] Fix compatibility with Smack 4.5.0-beta2
Browse files Browse the repository at this point in the history
Due to a change in Smack 4.5.0-beta2, test execution of (all) SINT tests is aborted when `FormTest` is executed.

It appears that Smack now has more strict argument validation when setting thread IDs on message stanzas. This validation should not fail for the tests that are shipped with Smack.
  • Loading branch information
guusdk committed Sep 18, 2024
1 parent d8d066b commit 1e9b53f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,22 @@ public void testFilloutForm() throws NotConnectedException, InterruptedException
completedForm.setAnswer("time", true);
completedForm.setAnswer("age", 20);
// Create a new message to send with the completed form
msg2 = StanzaBuilder.buildMessage()
Message msg3 = StanzaBuilder.buildMessage()
.to(conOne.getUser().asBareJid())
.setThread(msg.getThread())
.setThread(msg2.getThread())
.ofType(Message.Type.chat)
.setBody("To enter a case please fill out this form and send it back to me")
// Add the completed form to the message
.addExtension(completedForm.getDataFormToSubmit())
.build();
// Send the message with the completed form
conTwo.sendStanza(msg2);
conTwo.sendStanza(msg3);

// Get the message with the completed form
Message msg3 = collector.nextResult();
assertNotNull(msg3, "Message not found");
Message msg4 = collector.nextResult();
assertNotNull(msg4, "Message not found");
// Retrieve the completed form
final DataForm completedForm2 = DataForm.from(msg3);
final DataForm completedForm2 = DataForm.from(msg4);
assertNotNull(completedForm2);
assertNotNull(completedForm2.getField("name"));
assertNotNull(completedForm2.getField("description"));
Expand Down

0 comments on commit 1e9b53f

Please sign in to comment.