import static org.junit.Assert.assertEquals;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import org.apache.commons.lang.SerializationUtils;
+import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
/**
* @author Thomas Pantelis
*/
public class FollowerIdentifierTest {
-
@Test
- public void testSerialization() throws FileNotFoundException, IOException {
- FollowerIdentifier expected = new FollowerIdentifier("follower1");
- FollowerIdentifier cloned = (FollowerIdentifier) SerializationUtils.clone(expected);
+ public void testSerialization() {
+ final var expected = new FollowerIdentifier("follower1");
+ final var bytes = SerializationUtils.serialize(expected);
+ assertEquals(87, bytes.length);
+ final var cloned = (FollowerIdentifier) SerializationUtils.deserialize(bytes);
assertEquals("cloned", expected, cloned);
}
}