Skip to content

Cover in-memory fiscal-year and VAT operations after H2 fix - #140

Merged
perNyfelt merged 3 commits into
mainfrom
fix/129-in-memory-fiscal-years
Nov 13, 2026
Merged

perNyfelt merged 3 commits into
mainfrom
fix/129-in-memory-fiscal-years

Conversation

@perNyfelt

@perNyfelt perNyfelt commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Fiscal-year creation in in-memory test databases was blocked by H2 2.4.240's constant-list CHECK regression. The H2 upgrade to 2.5.252 in #127 already resolved the underlying bug, but the audit-log test still bypassed fiscal-year and VAT-period creation with a direct insert.

This removes that workaround, documents the supported operations in TestDatabaseUrls, and adds an integration regression test that creates a fiscal year, verifies accounting/VAT periods, and reports a VAT period after the schema-creating connection has closed. VAT rows are counted directly before calling listPeriods, ensuring the test detects missing period creation in createFiscalYear. It also checks persisted status, report validity, and audit-chain integrity. The regression test and audit-log test fixture explicitly shut down their in-memory databases; helper documentation describes the covered VAT constraint and the historical H2 fix.

Validation:

  • Focused DatabaseServiceTest and AuditLogServiceTest passed with H2 2.5.252.
  • Temporarily forcing H2 2.4.240 via an external Gradle init script makes the new regression test fail with the original CK_VAT_PERIOD_STATUS / closed-database error.
  • ./gradlew spotlessApply and ./gradlew codenarcMain passed.
  • ./gradlew build passed: 838 tests, zero failures or errors, 11 skipped; Spotless and CodeNarc passed.

Only test code and test-helper documentation change; no production, schema, or migration impact.

Closes #129.

@perNyfelt
perNyfelt merged commit 867d73c into main Nov 13, 2026
3 checks passed
@perNyfelt
perNyfelt deleted the fix/129-in-memory-fiscal-years branch November 13, 2026 20:57
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.

In-memory H2 test databases cannot create fiscal years (H2 2.4 constant-CHECK regression)

1 participant