Files
2026-09-09 15:29:51 +02:00

24 lines
2.9 KiB
Markdown

# Executable account acceptance scenarios
`IdentityCucumberTest` selects the service scenarios from the canonical `gherkin/identity-tests.feature`: WJ-010, WJ-011 (three unavailable-invitation examples), WJ-012, WJ-013, WJ-014, WJ-016, WJ-017, WJ-018 and WJ-019. WJ-015, browser-wide sign-out and draft removal, remains a separate browser acceptance requirement.
Each scenario uses a newly migrated H2 file and production email admission, device login, deletion proof, account deletion, administrative and tracking services. The fixture captures login and deletion messages in separate in-memory stores; no external mail is sent. Invitations are created through the real administrative service after email bootstrap. Concurrent redemptions use separate transactions and a bounded latch/future wait.
Protected service calls pass through the actual `DeviceAuthenticationFilter` with a device cookie and use `AuthenticatedCurrentUser`. This verifies current account resolution and private ownership at the service boundary, including rejection after disabling both devices and after thirty days of passive heartbeats. It is not an HTTP server, CSRF or browser rendering test; those integration tests and browser acceptance remain separate.
Private work and habit records are created through their real services. Foreign reads and writes must throw `RecordNotFound`, leave both users' data unchanged and still allow account-status administration. Disabling the owner must preserve tracking records and prevent the real reminder dispatcher from reaching the test transport. Its pre-existing push subscription rows are fixtures; subscription registration is covered by the push suite.
Deletion uses a dedicated captured email code and a separate explicit confirmation. The tests verify data and device credential removal, a different account identity with no former data or admin rights on reinvitation, and recovery after deleting the sole administrator. Recovery uses `AdminRecovery.issue`, requires a new email proof and cannot be reused; the old bootstrap code stays consumed. Scenarios WJ-016 and WJ-019 now name the already agreed dedicated deletion email instead of the obsolete generic reauthentication wording.
Run with:
```sh
JAVA_HOME=/path/to/jdk25 ./gradlew --no-daemon test --tests '*IdentityCucumberTest' -Pproduction=true
```
The normal `tools/ci-jvm` task includes this suite. Its report is `build/reports/cucumber/identity-service.json`.
Focused validation: all 11 selected account examples completed with every Cucumber step passed. This node adds executable bindings and updates obsolete scenario wording; it makes no production code or database schema changes.
Full local CI for 0.1.31-SNAPSHOT passed: 184 reported JVM cases, 173 executed with zero failures/errors and 11 skipped browser/harness cases. All 42 bound Gherkin examples passed (11 identity, 12 push, six habit and 13 work), as did 68 operations tests, 17 frontend tests, production startup and admin recovery checks.