1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-16 16:44:48 +02:00
Smack/smack-experimental/src/test/java/org/jivesoftware/smackx/mix/core/element/SetNickElementTest.java

27 lines
770 B
Java
Raw Normal View History

2020-02-29 01:46:54 +01:00
package org.jivesoftware.smackx.mix.core.element;
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
public class SetNickElementTest {
@Test
public void v1Test() {
String expectedXml = "" +
"<setnick xmlns='urn:xmpp:mix:core:1'>\n" +
" <nick>thirdwitch</nick>\n" +
"</setnick>";
SetNickElement element = new SetNickElement.V1("thirdwitch");
assertXmlSimilar(expectedXml, element.toXML());
}
@Test
public void disallowNullNickTest() {
assertThrows(IllegalArgumentException.class, () -> new SetNickElement.V1((NickElement) null));
}
}