mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-07 17:29:44 +02:00
Verification: Rename description to jsonOrDescription
This commit is contained in:
parent
5a7a8ae901
commit
bff4423f93
2 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue