Improve coverage for MastershipTerm class
Change-Id: Ic0c85f8f33a35560554f9f12db0b64019ce9afe5
diff --git a/core/api/src/test/java/org/onosproject/mastership/MastershipTermTest.java b/core/api/src/test/java/org/onosproject/mastership/MastershipTermTest.java
index d38f3e9..0ca9436 100644
--- a/core/api/src/test/java/org/onosproject/mastership/MastershipTermTest.java
+++ b/core/api/src/test/java/org/onosproject/mastership/MastershipTermTest.java
@@ -16,6 +16,7 @@
package org.onosproject.mastership;
import static org.junit.Assert.assertEquals;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
import org.junit.Test;
import org.onosproject.cluster.NodeId;
@@ -42,7 +43,15 @@
public void testEquality() {
new EqualsTester().addEqualityGroup(MastershipTerm.of(N1, 0), TERM1)
.addEqualityGroup(TERM2, TERM3)
- .addEqualityGroup(TERM4);
+ .addEqualityGroup(TERM4)
+ .testEquals();
}
+ /**
+ * Checks that the MembershipTerm class is immutable.
+ */
+ @Test
+ public void testImmutability() {
+ assertThatClassIsImmutable(MastershipTerm.class);
+ }
}