use of org.onosproject.mastership.MastershipTerm in project onos by opennetworkinglab.
the class MastershipTermCodecTest method testMastershipTermEncode.
/**
* Tests encoding of a mastership term object.
*/
@Test
public void testMastershipTermEncode() {
NodeId masterNodeId = NodeId.nodeId("1");
long termNumber = 10;
MastershipTerm mastershipTerm = MastershipTerm.of(masterNodeId, termNumber);
ObjectNode mastershipTermJson = mastershipTermCodec.encode(mastershipTerm, context);
assertThat(mastershipTermJson, MastershipTermJsonMatcher.matchesMastershipTerm(mastershipTerm));
}
Aggregations