mengw15 opened a new pull request, #7167:
URL: https://github.com/apache/texera/pull/7167
### What changes were proposed in this PR?
Adds `AdminUserResourceSpec`, the first spec for `AdminUserResource`
(previously
~0% coverage). It runs against embedded Postgres via `MockTexeraDB` and seeds
rows through the jOOQ DAOs, with 12 tests covering the admin user-management
methods, empty and populated:
- `list` — returns the seeded users with name / email / role.
- `addUser` — persists a new `INACTIVE` user.
- `updateUser` — round-trips an editable-field change; rejects an email that
already belongs to another user (`WebApplicationException`).
- `getCreatedWorkflow` / `getAccessedWorkflow` — the per-user created /
accessible
workflow lists.
- `getUserQuota` — the per-user quota view.
- `deleteCollection` — removes the target execution row.
Two side-effecting branches are intentionally left to their owning code
paths so
this stays a hermetic unit test: `updateUser`'s role-change branch (sends an
e-mail via `GmailResource`) is not exercised — only the no-role-change and
conflict paths are; and `deleteCollection` is asserted on its DB delete (the
Iceberg document cleanup is a best-effort, exception-swallowed step).
### Any related issues, documentation, discussions?
Closes #7163.
### How was this PR tested?
`sbt "WorkflowExecutionService/testOnly *AdminUserResourceSpec"` — 12
succeeded, 0 failed. `Test/scalafmtCheck` and `Test/scalafix --check` clean.
Failure path verified by breaking an assertion (→ 1 failed, non-zero exit) and
restoring.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]