mengw15 opened a new pull request, #7229:
URL: https://github.com/apache/texera/pull/7229
### What changes were proposed in this PR?
Extends the existing `MockTexeraDB`-backed `WorkflowResourceSpec` to cover
the
read/query and mutation jOOQ endpoints of `WorkflowResource`
(`amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala`),
which were largely untested. No production code was changed.
+14 tests (each seeds its own workflow via `createWorkflow`; `afterEach`
deletes
them):
- `retrieveWorkflow` — returns the workflow for a user with access; throws
`ForbiddenException` for a user without access.
- `retrieveIDs` / `retrieveOwners` — the user's accessible workflow ids, and
the
owner listing (empty for a user who owns nothing).
- `getWorkflowName` / `getWorkflowType` / `getWorkflowDescription` /
`getOwnerName`
/ `getSize` — the per-workflow lookups (plus `getSize` on a null/empty id
list).
- `updateWorkflowName` / `updateWorkflowDescription` — the change
round-trips.
- `makePublic` / `makePrivate` — flip the public flag, with
`getWorkflowType` and
`retrievePublicWorkflow` reflecting it, and a `ForbiddenException` for a
user
without write access.
- `searchWorkflowByOperator` — returns only workflows whose content contains
the
operator.
- `duplicateWorkflow` — creates a distinct `_copy` owned by the user.
Out of scope: the three cover-image endpoints (`getCoverImage` /
`setCoverImage`
/ `deleteCoverImage`) go through `DocumentFactory` storage, per the issue.
`cloneWorkflow` is left out here because it takes an `HttpServletRequest` and
records a clone action; `workflowExistsInDb` is a local value inside
`persistWorkflow` (already covered), not a public endpoint.
### Any related issues, documentation, discussions?
Closes #7224
### How was this PR tested?
Extended unit tests, run locally against embedded Postgres (`MockTexeraDB`).
All
pass, and the failure path was verified by breaking an assertion to confirm
the
suite goes red:
```
sbt "WorkflowExecutionService/testOnly *WorkflowResourceSpec"
# Tests: succeeded 52, failed 0
sbt "WorkflowExecutionService/Test/scalafmtCheck" # clean
sbt "WorkflowExecutionService/Test/scalafix --check" # clean
```
### 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]