zjncs opened a new pull request, #5695:
URL: https://github.com/apache/rocketmq-dashboard/pull/5695
### What
`DLQProviderStub` — the fallback `DLQProvider` used when no real DLQ
provider is configured — had no test. This adds `DLQProviderStubTest` with 8
tests pinning its fail-closed contract.
### Why
The stub is what every DLQ operation lands on in a deployment without a real
provider. If it ever stops failing closed — a wrong status code, a raw runtime
exception instead of the structured error, a changed message — operators lose
the one signal that explains *why* every DLQ screen is an error, and the AI
tool layer surfaces an unstructured failure instead of the not-configured
notice. Nothing pinned that.
### What is pinned
All seven interface methods fail closed identically:
- `listDLQGroups` (plain and paged), `resendMessages` (time window and
selected), `exportMessages`, `exportExcel`, `listMessages` — each throws the
structured `BusinessException` with code **501** and the exact message `DLQ
provider is not configured`;
- the stub satisfies the `DLQProvider` contract.
### Verification
- New tests on unmodified code: **8/8 green** (`mvn test
-Dtest=DLQProviderStubTest`).
- Discriminating mutations on `DLQProviderStub`, build result verified red
each time:
1. 501 downgraded to 500 on `listDLQGroups` — the code assertion reddens;
2. structured error swapped for a raw `IllegalStateException` on
resend-selected — the type assertion reddens;
3. message text changed — the message assertion reddens.
- Restored: 8/8 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]