Committed by
Gerrit Code Review
Improve coverage for MastershipTerm class
Change-Id: Ic0c85f8f33a35560554f9f12db0b64019ce9afe5
Showing
1 changed file
with
10 additions
and
1 deletions
... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
16 | package org.onosproject.mastership; | 16 | package org.onosproject.mastership; |
17 | 17 | ||
18 | import static org.junit.Assert.assertEquals; | 18 | import static org.junit.Assert.assertEquals; |
19 | +import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable; | ||
19 | 20 | ||
20 | import org.junit.Test; | 21 | import org.junit.Test; |
21 | import org.onosproject.cluster.NodeId; | 22 | import org.onosproject.cluster.NodeId; |
... | @@ -42,7 +43,15 @@ public class MastershipTermTest { | ... | @@ -42,7 +43,15 @@ public class MastershipTermTest { |
42 | public void testEquality() { | 43 | public void testEquality() { |
43 | new EqualsTester().addEqualityGroup(MastershipTerm.of(N1, 0), TERM1) | 44 | new EqualsTester().addEqualityGroup(MastershipTerm.of(N1, 0), TERM1) |
44 | .addEqualityGroup(TERM2, TERM3) | 45 | .addEqualityGroup(TERM2, TERM3) |
45 | - .addEqualityGroup(TERM4); | 46 | + .addEqualityGroup(TERM4) |
47 | + .testEquals(); | ||
46 | } | 48 | } |
47 | 49 | ||
50 | + /** | ||
51 | + * Checks that the MembershipTerm class is immutable. | ||
52 | + */ | ||
53 | + @Test | ||
54 | + public void testImmutability() { | ||
55 | + assertThatClassIsImmutable(MastershipTerm.class); | ||
56 | + } | ||
48 | } | 57 | } | ... | ... |
-
Please register or login to post a comment