zjncs opened a new pull request, #5679: URL: https://github.com/apache/rocketmq-dashboard/pull/5679
### Problem `Acl2PolicyContext` — the DTO carrying enhanced ACL 2.0 policy data between the controller and service layers — had **no test**. ### Change Add `Acl2PolicyContextTest` with fourteen tests: | Contract | Pinned behaviour | | --- | --- | | required fields | minimal policy (accessKey + policyName) passes; blank accessKey/policyName rejected by name | | rules semantics | an **empty** rules list is rejected while an **absent** one is allowed — deliberate (absent means inherit; an empty list authorizes nothing) | | indexed errors | a missing resourcePattern or actions list names `rules[i]` | | effect handling | case-insensitive (lowercase allow/deny pass verbatim); unknown effect rejected naming the value; a missing effect defaults to Allow **and is written back onto the rule** | | boundType | accepts exactly USER / GROUP / SERVICE_ACCOUNT; rejects anything else naming the legal values | | factories | `defaultAllowRule` carries the backward-compatible shape (READ+WRITE / Allow / priority 100); `denyAllRule` has the **highest precedence** (priority 0 sorts before the default 100, so the deny wins on conflict) with the `**` catch-all pattern | | admin flag | round-trips through its explicit accessors (the field opts out of Lombok's boolean is-getter naming) | ### Verification - New tests: **14/14 green** against unmodified code. - Discriminating mutations on `Acl2PolicyContext` (build result verified): empty-rules rejection dropped (**red**); null-effect Allow default dropped (**red**); boundType validation dropped (**red**); `denyAllRule` precedence flattened to 100 (**red**); the effect check made case-sensitive (**red** — lowercase `deny` must pass). - Restored: 14/14 green. No product code changed. -- 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]
