zjncs opened a new pull request, #5740:
URL: https://github.com/apache/rocketmq-dashboard/pull/5740
### What
`Result` — the REST envelope every endpoint answers with — had no test. This
adds `ResultTest` with 4 tests.
### What is pinned
- `ok(data)` carries the payload with the **stable 200/success envelope**
that every front-end interceptor branches on;
- `ok()` has the same envelope with null data;
- **error carries the code and the message and never data** — a
half-populated error envelope reads as a success that lost its payload;
- the envelope is constructed only through its factories: both constructors
stay private, so no endpoint can build a lopsided envelope.
### Verification
- New tests on unmodified code: **4/4 green**, checkstyle clean (`mvn test
-Dtest=ResultTest`).
- Discriminating mutations on `Result`, build result verified red each time:
1. error carrying a stale data slot — red;
2. the success message reworded — red;
3. the ok code shifted from 200 to 0 — red.
- Restored: 4/4 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]