mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-24 11:57:59 +01:00
Test Certification class
This commit is contained in:
parent
be0e89f9f8
commit
1a5d131b9c
1 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.CertSynopsis
|
||||
import org.pgpainless.wot.dijkstra.sq.Certification
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.RevocationState
|
||||
import java.util.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class CertificationTest {
|
||||
|
||||
private val alice = CertSynopsis(
|
||||
Fingerprint("0000000000000000000000000000000000000000"),
|
||||
null,
|
||||
RevocationState.notRevoked(),
|
||||
mapOf(Pair("Alice <alice@pgpainless.org>", RevocationState.notRevoked())))
|
||||
private val bob = CertSynopsis(
|
||||
Fingerprint("1111111111111111111111111111111111111111"),
|
||||
null,
|
||||
RevocationState.notRevoked(),
|
||||
mapOf(Pair("Bob <bob@example.org>", RevocationState.notRevoked())))
|
||||
|
||||
@Test
|
||||
fun testToString() {
|
||||
val certification = Certification(alice, "Bob <bob@example.org>", bob, Date())
|
||||
assertEquals("0000000000000000000000000000000000000000 (Alice <alice@pgpainless.org>) certifies [Bob <bob@example.org>] 1111111111111111111111111111111111111111",
|
||||
certification.toString())
|
||||
val delegation = Certification(alice, null, bob, Date())
|
||||
assertEquals("0000000000000000000000000000000000000000 (Alice <alice@pgpainless.org>) delegates to 1111111111111111111111111111111111111111",
|
||||
delegation.toString())
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue