Skip to content

#292 Add integration tests for PDF signing pipeline#293

Merged
kwart merged 6 commits intomasterfrom
claude/add-tests
Feb 21, 2026
Merged

#292 Add integration tests for PDF signing pipeline#293
kwart merged 6 commits intomasterfrom
claude/add-tests

Conversation

@kwart
Copy link
Copy Markdown
Member

@kwart kwart commented Feb 21, 2026

Summary

  • Add 33 integration tests for SignerLogic.signFile() — the core signing pipeline that previously had zero test coverage
  • Validate signed PDFs using Apache PDFBox + BouncyCastle CMS, fully independent from the production OpenPDF library
  • No production code changes, no pom.xml changes (all dependencies already on classpath)

Test Coverage

Class Tests What it covers
BasicSigningTest 3 Default signing works, returns true, output > input
HashAlgorithmSigningTest 5 SHA1, SHA256, SHA384, SHA512, RIPEMD160
KeyTypeSigningTest 8 RSA1024/2048/4096 + DSA1024 × JKS/PKCS12
SignatureMetadataTest 6 Reason, location, contact, combined, empty, sign date
CertificationLevelSigningTest 4 NOT_CERTIFIED + 3 certified levels
AppendModeSigningTest 3 Append mode, non-append, append preserves original bytes
VisibleSignatureSigningTest 3 Invisible default, visible with position, custom L2 text
MultipleSignaturesTest 1 Sign already-signed PDF, verify 2 signatures

Test plan

  • mvn clean verify — 35 tests (2 existing + 33 new), 0 failures, 0 errors

Closes #292

🤖 Generated with Claude Code

kwart-azul and others added 6 commits February 21, 2026 11:07
Add 33 tests covering SignerLogic.signFile() using PDFBox + BouncyCastle
CMS for independent signature validation. Tests cover hash algorithms,
key types, metadata, certification levels, append mode, visible
signatures, and multiple signatures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add font-aware text extraction to PdfSignatureValidator using PDFBox
font decoding (PDFont.toUnicode) to properly handle subset font
encoding in appearance streams. Extend VisibleSignatureSigningTest
from 3 to 5 tests covering rectangle position, page number, L2 text
placeholder substitution, and default appearance text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kwart kwart merged commit 314958d into master Feb 21, 2026
1 check passed
@kwart kwart deleted the claude/add-tests branch February 21, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend test coverage for PDF signing pipeline

2 participants