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

   ### What
   
   `ClientProviderStub` — the fallback `ClientProvider` used when no real 
client connection provider is configured — had no test. This adds 
`ClientProviderStubTest` with 6 tests pinning its fail-closed contract.
   
   ### Why
   
   The stub is what every client-connection lookup lands on in a deployment 
without a provider. If it ever stops failing closed — an empty answer that 
reads as "no clients connected", a wrong status code, a raw runtime exception 
instead of the structured error — operators lose the one signal that explains 
*why* the producer/client screens error out. Nothing pinned that, including the 
two interface defaults whose composed behavior is the subtle part.
   
   ### What is pinned
   
   - `findConnections`, `findProducerGroups` and `findProducerConnections` — 
each throws the structured `BusinessException` with code **501** and the exact 
message `Client connection provider is not configured`;
   - the inherited `findConnectionsAt` default keeps its **own distinct** 
not-supported message (`Client connection provider does not support nameserver 
lookup`) instead of masquerading as the not-configured error;
   - the inherited `scanProducerConnections` default **propagates** the stub's 
structured error rather than swallowing it into an empty `complete` scan, which 
would silently report zero producer connections as a fact;
   - the stub satisfies the `ClientProvider` contract.
   
   ### Verification
   
   - New tests on unmodified code: **6/6 green** (`mvn test 
-Dtest=ClientProviderStubTest`).
   - Discriminating mutations on `ClientProviderStub`, build result verified 
red each time:
     1. 501 downgraded to 500 on `findConnections` — the code assertion reddens;
     2. structured error swapped for a raw `IllegalStateException` on 
`findProducerGroups` — the type assertion reddens;
     3. message text changed on `findProducerConnections` — reddens **both** 
the direct test and the scan-propagation test, confirming the composed contract 
is genuinely covered.
   - Restored: 6/6 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]

Reply via email to