mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 14:22:05 +01:00
Add more tests for RevocationState
This commit is contained in:
parent
ae6a427d90
commit
6913aa3d6d
1 changed files with 13 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue