ProtocolLib/src/test/java/com/comphenix/protocol/wrappers/WrappedChatComponentTest.java
2018-09-22 17:48:06 -04:00

28 lines
658 B
Java

package com.comphenix.protocol.wrappers;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.BeforeClass;
import org.junit.Test;
import com.comphenix.protocol.BukkitInitialization;
public class WrappedChatComponentTest {
@BeforeClass
public static void initializeBukkit() {
BukkitInitialization.initializePackage();
}
@Test
public void testText() {
WrappedChatComponent test = WrappedChatComponent.fromText("Hello.");
String json = test.getJson();
assertNotNull(json);
WrappedChatComponent clone = WrappedChatComponent.fromJson(json);
assertEquals(json, clone.getJson());
}
}