yyqdbngt opened a new pull request, #3563:
URL: https://github.com/apache/rocketmq-dashboard/pull/3563
### Summary
Adds the first dedicated unit test suite for the `ToolPermission` record,
which parses the resource/action pairs that gate MCP tool access.
The parsing contract includes trimming, lower-casing, optional action and
tolerance of extra colons; a blank or null raw value yields an empty
permission. The tests also pin the read-only predicate.
### Changes
-
`server/src/test/java/org/apache/rocketmq/studio/ops/ai/tool/ToolPermissionTest.java`
- `parsesResourceAndAction`: `TOPIC:read` splits into resource/action.
- `normalizesToLowerCaseAndTrims`: mixed-case input with padding is
normalized.
- `actionDefaultsToEmptyWhenMissing`: a bare resource yields an empty
action.
- `toleratesExtraColonsInValue`: everything after the first colon stays in
the action.
- `blankInputYieldsEmptyPermission` / `nullInputYieldsEmptyPermission`:
degenerate inputs map to empty permission.
- `readActionIsReadOnly`: only the `read` action is read-only.
### Testing
- `mvn -B test -Dtest=ToolPermissionTest` passes (7 tests, all green).
--
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]