zjncs opened a new pull request, #5762:
URL: https://github.com/apache/rocketmq-dashboard/pull/5762
### What
`TopicRouteItem` — the tool-side projection of one broker's route entry for
a topic — had no test. This adds `TopicRouteItemTest` with 3 tests.
### What is pinned
- every route field maps through: broker identity, the full replica address
map, queue counts, the permission code, readability and the system flag;
- **the perm travels as its wire name** (RW/RO/WO) — the tool contract is
JSON and the enum name is the value consumers branch on;
- **an unknown perm survives as null** (a broker advertising a value this
build's enum does not know) rather than crashing the whole route listing.
### Verification
- New tests on unmodified code: **3/3 green**, checkstyle clean (`mvn test
-Dtest=TopicRouteItemTest`).
- Discriminating mutations on `TopicRouteItem`, build result verified red
each time:
1. the perm translation crashing on null — red;
2. the perm hardcoded to `RW` so every route reads as writable — red;
3. the replica address map dropped from the projection — red.
- Transparency note: a `name()`-vs-`toString()` mutation was tried first and
stayed green — for an enum without a `toString` override the two are
behaviourally identical — so the hardcoded-constant mutation was used instead.
- Restored: 3/3 green. Test-only change; no product code touched.
--
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]