diff --git a/jxmpp-jid/src/test/java/org/jxmpp/jid/impl/JidCreateTest.java b/jxmpp-jid/src/test/java/org/jxmpp/jid/impl/JidCreateTest.java index cbc90f7..3bfdfad 100644 --- a/jxmpp-jid/src/test/java/org/jxmpp/jid/impl/JidCreateTest.java +++ b/jxmpp-jid/src/test/java/org/jxmpp/jid/impl/JidCreateTest.java @@ -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 = " foo@leadingAndTrailingWhitespaceTest.org "; + assertThrows(XmppStringprepException.class, () -> JidCreate.from(invalidJid) ); + + String invalidJid2 = " foo@leadingAndTrailingWhitespaceTest.org/bar "; + assertThrows(XmppStringprepException.class, () -> JidCreate.from(invalidJid2) ); + } }