Verification: Rename description to jsonOrDescription

This commit is contained in:
Paul Schaub 2025-06-03 14:30:54 +02:00
parent 5a7a8ae901
commit bff4423f93
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 9 additions and 4 deletions

View file

@ -45,12 +45,12 @@ public final class VerificationAssert {
}
public VerificationAssert hasDescription(String description) {
assertEquals(description, verification.getDescription().get());
assertEquals(description, verification.getJsonOrDescription().get());
return this;
}
public VerificationAssert hasDescriptionOrNull(String description) {
if (verification.getDescription().isEmpty()) {
if (verification.getJsonOrDescription().isEmpty()) {
return this;
}

View file

@ -15,7 +15,7 @@ data class Verification(
val signingKeyFingerprint: String,
val signingCertFingerprint: String,
val signatureMode: Optional<SignatureMode>,
val description: Optional<String>
val jsonOrDescription: Optional<String>
) {
@JvmOverloads
constructor(
@ -31,10 +31,15 @@ data class Verification(
Optional.ofNullable(signatureMode),
Optional.ofNullable(description?.trim()))
@Deprecated("Replaced by jsonOrDescription",
replaceWith = ReplaceWith("jsonOrDescription")
)
val description = jsonOrDescription
override fun toString(): String =
"${UTCUtil.formatUTCDate(creationTime)} $signingKeyFingerprint $signingCertFingerprint" +
(if (signatureMode.isPresent) " mode:${signatureMode.get()}" else "") +
(if (description.isPresent) " ${description.get()}" else "")
(if (jsonOrDescription.isPresent) " ${jsonOrDescription.get()}" else "")
companion object {
@JvmStatic