CertifyValidateUserIdTest: unbound User-IDs do throw exceptions

This commit is contained in:
Paul Schaub 2025-06-02 12:57:11 +02:00
parent 61206dde53
commit e1d048225b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -14,7 +14,6 @@ import sop.exception.SOPGPException;
import java.io.IOException;
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.assertTrue;
@ -53,7 +52,8 @@ public class CertifyValidateUserIdTest {
"Alice accepts her own self-certified user-id");
// Alice has not yet certified Bobs user-id
assertFalse(sop.validateUserId()
assertThrows(SOPGPException.CertUserIdNoMatch.class, () ->
sop.validateUserId()
.authorities(aliceCert)
.userId("Bob <bob@pgpainless.org>")
.subjects(bobCert),
@ -152,7 +152,8 @@ public class CertifyValidateUserIdTest {
.subjects(bobWithPetName),
"Alice accepts the pet-name she gave to Bob");
assertFalse(sop.validateUserId()
assertThrows(SOPGPException.CertUserIdNoMatch.class, () ->
sop.validateUserId()
.userId("Bobby")
.authorities(bobWithPetName)
.subjects(bobWithPetName),