yyqdbngt opened a new pull request, #3249:
URL: https://github.com/apache/rocketmq-dashboard/pull/3249

   ## Summary
   
   Adds `AuthenticatedUserContextTest`, a first unit test for the per-thread 
principal holder used across services and controllers. The context is cleared 
before each test so results do not depend on sibling tests.
   
   Coverage:
   - default state: no username → `system` actor, no user id, non-admin, and 
`currentUserIsAdminOrSystem()` true (an unset admin flag is treated as system);
   - the two-argument setter carries the admin flag; the username-only setter 
defaults to non-admin;
   - non-admin principals are not system-privileged;
   - the numeric setters record the user id as a string;
   - `setUser(null, ...)` and `clear()` both reset to the system actor.
   
   ## Why
   
   Admin/system authorization gates (e.g. AI tool execution) read this context; 
its default semantics had no direct test.
   
   ## Testing
   
   `mvn -B test -Dtest=AuthenticatedUserContextTest` — 6/6 pass; checkstyle 
(validate) clean.


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