Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add sal-akka-raft serialization assertions
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
persisted
/
EmptyStateTest.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/EmptyStateTest.java
b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/EmptyStateTest.java
index 963580cde4b04828cbe08b90bc70cebbaf4fd4ba..184b43b3c3e7a199dfdc977c8d65c9637f48fe0b 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/EmptyStateTest.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/EmptyStateTest.java
@@
-7,6
+7,7
@@
*/
package org.opendaylight.controller.cluster.raft.persisted;
*/
package org.opendaylight.controller.cluster.raft.persisted;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import org.apache.commons.lang.SerializationUtils;
import static org.junit.Assert.assertSame;
import org.apache.commons.lang.SerializationUtils;
@@
-19,10
+20,11
@@
import org.junit.Test;
*
*/
public class EmptyStateTest {
*
*/
public class EmptyStateTest {
-
@Test
public void testSerialization() {
@Test
public void testSerialization() {
- EmptyState cloned = (EmptyState) SerializationUtils.clone(EmptyState.INSTANCE);
+ final var bytes = SerializationUtils.serialize(EmptyState.INSTANCE);
+ assertEquals(82, bytes.length);
+ final var cloned = SerializationUtils.deserialize(bytes);
assertSame("cloned", EmptyState.INSTANCE, cloned);
}
}
assertSame("cloned", EmptyState.INSTANCE, cloned);
}
}