diff --git a/pgpainless-core/src/test/java/org/pgpainless/algorithm/RevocationStateTest.java b/pgpainless-core/src/test/java/org/pgpainless/algorithm/RevocationStateTest.java index c1e45413..e23d92d3 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/algorithm/RevocationStateTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/algorithm/RevocationStateTest.java @@ -72,6 +72,8 @@ public class RevocationStateTest { Date now = new Date(); assertEquals(RevocationState.softRevoked(now), RevocationState.softRevoked(now)); + assertEquals(1, RevocationState.softRevoked(now).compareTo(RevocationState.notRevoked())); + assertEquals(0, RevocationState.notRevoked().compareTo(RevocationState.notRevoked())); assertEquals(0, RevocationState.hardRevoked().compareTo(RevocationState.hardRevoked())); assertTrue(RevocationState.hardRevoked().compareTo(RevocationState.notRevoked()) > 0); @@ -93,4 +95,15 @@ public class RevocationStateTest { assertEquals(states, Arrays.asList(not, not2, laterSoft, earlySoft, hard)); } + + @SuppressWarnings({"SimplifiableAssertion", "ConstantConditions", "EqualsWithItself", "EqualsBetweenInconvertibleTypes"}) + @Test + public void equalsTest() { + RevocationState rev = RevocationState.hardRevoked(); + assertFalse(rev.equals(null)); + assertTrue(rev.equals(rev)); + assertFalse(rev.equals("not a revocation")); + RevocationState other = RevocationState.notRevoked(); + assertFalse(rev.equals(other)); + } }