aglinxinyuan opened a new pull request, #7305:
URL: https://github.com/apache/texera/pull/7305

   ### What changes were proposed in this PR?
   
   `ProjectResourceSpec` exercised the create / rename / describe / add / 
remove / delete paths, but three of the resource's methods were never called by 
it. Six tests for those:
   
   **`updateProjectColor`** — the only one with real validation:
   
   ```scala
   if (colorHex == null || colorHex.length != 6 && colorHex.length != 3 || 
!colorHex.matches(...))
   ```
   
   The guard checks length **and** hex-ness, so the rejection test covers both 
kinds of bad input: a length-only check would let `"GGGGGG"` through, and a 
regex-only check would let `""` through. It also asserts a rejected update 
leaves the previously stored colour intact, and that the null check precedes 
the length read — without it a null colour is an NPE rather than a 400. Both 
the 3- and 6-digit forms are accepted, and the value is stored verbatim rather 
than expanded.
   
   **`deleteProjectColor`** — clears the value.
   
   **`listProjectWorkflows`** — filters by project id. The test seeds **two** 
projects each holding one workflow, so a filter that ignored the pid would 
return both and fail; plus a project holding none returns empty.
   
   These are additions to the spec's existing `MockTexeraDB` fixture, not new 
infrastructure.
   
   For transparency on scope: `WorkflowVersionResource` (12 missed, 88.4%) was 
looked at as a companion for this PR and deliberately left out. Every one of 
its methods is already exercised by its spec, so the residue is branch-level 
and did not look reachable without padding.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7302
   
   ### How was this PR tested?
   
   Six new tests, run as the whole spec so the pre-existing cases are proven 
intact — 16 tests, Java 17:
   
   ```
   sbt "WorkflowExecutionService/testOnly 
org.apache.texera.web.resource.dashboard.user.project.ProjectResourceSpec"
   ```
   
   ```
   [info] Tests: succeeded 16, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   ```
   
   `Test/scalafmtCheck` and `Test/scalafix --check` both `[success]`.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   
   


-- 
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]

Reply via email to