Skip to content

Commit

Permalink
[jid] Add test for leading and trailing whitespace in input
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Jan 18, 2024
1 parent 71e8fd2 commit 084fbad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions jxmpp-jid/src/test/java/org/jxmpp/jid/impl/JidCreateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,13 @@ public void noCachedJidShadowingLocalpartTest() throws XmppStringprepException {
String invalidJid = "@noCachedJidShadowingLocalpartTest.org";
assertThrows(XmppStringprepException.class, () -> JidCreate.from(invalidJid) );
}

@Test
public void leadingAndTrailingWhitespaceTest() throws XmppStringprepException {
String invalidJid = " [email protected] ";
assertThrows(XmppStringprepException.class, () -> JidCreate.from(invalidJid) );

String invalidJid2 = " [email protected]/bar ";
assertThrows(XmppStringprepException.class, () -> JidCreate.from(invalidJid2) );
}
}

0 comments on commit 084fbad

Please sign in to comment.