use of org.neo4j.causalclustering.messaging.NetworkFlushableChannelNetty4 in project neo4j by neo4j.
the class RaftMembershipStateTest method shouldMarshalCorrectly.
@Test
public void shouldMarshalCorrectly() throws Exception {
// given
RaftMembershipState.Marshal marshal = new RaftMembershipState.Marshal();
state = new RaftMembershipState(5, new MembershipEntry(7, membersA), new MembershipEntry(8, membersB));
// when
ByteBuf buffer = Unpooled.buffer(1_000);
marshal.marshal(state, new NetworkFlushableChannelNetty4(buffer));
final RaftMembershipState recovered = marshal.unmarshal(new NetworkReadableClosableChannelNetty4(buffer));
// then
assertEquals(state, recovered);
}
Aggregations