The GitHub Actions job "Required Checks" on texera.git/main has failed.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
938342afb31a8b51faeec75e5d98116a694b11e2 / Meng Wang <[email protected]>
test(amber): add specs for GuestAuthFilter and UserResource (#7652)

### What changes were proposed in this PR?

Adds specs for two amber classes that had none. No production code was
changed.

**`GuestAuthFilterSpec`** (+8 tests) — pure, no database. The filter is
built
through its `Builder` with a small test authorizer, run over a stubbed
`ContainerRequestContext`, and the `SecurityContext` it installs is
captured and
asserted:

- `getUserPrincipal` is a `SessionUser` wrapping
`GuestAuthFilter.GUEST`;
- `isUserInRole` delegates to the authorizer — both an allowed and a
denied role;
- `isSecure` inherits from the incoming context — secure, insecure, and
the
  **null** incoming context the code guards for;
- `getAuthenticationScheme` reflects the scheme `filter()` authenticates
with.

Plus the `GUEST` preset's fields and `Builder` returning a fresh filter
each time.

**`UserResourceSpec`** (+7 tests) — jOOQ against embedded Postgres via
`MockTexeraDB`:

- `isJoiningReasonRequired` — true while unset, false once stored, and a
404
  `WebApplicationException` for an unknown uid;
- `updateJoiningReason` — persists affiliation/reason and flips the
prompt off,
  trims both values, and defaults a null affiliation to an empty string.

Two branches the issue does not mention are covered as well, since they
are the
guard `updateJoiningReason` opens with: a blank/whitespace reason and a
null
reason each raise 400, and the blank case is asserted to leave the
stored user
untouched.

### Any related issues, documentation, discussions?

Closes #7650

### How was this PR tested?

Unit tests, run locally (the `UserResource` half against embedded
Postgres). All
pass, and the failure path was verified by breaking an assertion to
confirm the
suite goes red:

```
sbt "WorkflowExecutionService/testOnly *GuestAuthFilterSpec *UserResourceSpec"
# Tests: succeeded 33, 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])

Report URL: https://github.com/apache/texera/actions/runs/31777280374

With regards,
GitHub Actions via GitBox

Reply via email to