mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-09 02:09:42 +02:00
CertifyValidateUserIdTest: unbound User-IDs do throw exceptions
This commit is contained in:
parent
61206dde53
commit
e1d048225b
1 changed files with 25 additions and 24 deletions
|
@ -14,7 +14,6 @@ import sop.exception.SOPGPException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
@ -53,7 +52,8 @@ public class CertifyValidateUserIdTest {
|
||||||
"Alice accepts her own self-certified user-id");
|
"Alice accepts her own self-certified user-id");
|
||||||
|
|
||||||
// Alice has not yet certified Bobs user-id
|
// Alice has not yet certified Bobs user-id
|
||||||
assertFalse(sop.validateUserId()
|
assertThrows(SOPGPException.CertUserIdNoMatch.class, () ->
|
||||||
|
sop.validateUserId()
|
||||||
.authorities(aliceCert)
|
.authorities(aliceCert)
|
||||||
.userId("Bob <bob@pgpainless.org>")
|
.userId("Bob <bob@pgpainless.org>")
|
||||||
.subjects(bobCert),
|
.subjects(bobCert),
|
||||||
|
@ -152,7 +152,8 @@ public class CertifyValidateUserIdTest {
|
||||||
.subjects(bobWithPetName),
|
.subjects(bobWithPetName),
|
||||||
"Alice accepts the pet-name she gave to Bob");
|
"Alice accepts the pet-name she gave to Bob");
|
||||||
|
|
||||||
assertFalse(sop.validateUserId()
|
assertThrows(SOPGPException.CertUserIdNoMatch.class, () ->
|
||||||
|
sop.validateUserId()
|
||||||
.userId("Bobby")
|
.userId("Bobby")
|
||||||
.authorities(bobWithPetName)
|
.authorities(bobWithPetName)
|
||||||
.subjects(bobWithPetName),
|
.subjects(bobWithPetName),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue