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

   ### Which Issue(s) This PR Fixes
   
   None — test-coverage gap found by inspection (no issue tracked).
   
   ### Brief Description
   
   `MetricsService.queryInstance` selects the data source for tool queries: 
exactly one dedicated source wins; otherwise the sole shared source bound to 
the instance is accepted; anything else is a loud 409. The existing tests 
covered dedicated-over-shared, sole-shared, no-binding and two-shared-sources, 
but not the **multiple dedicated sources** branch — the guard that keeps a 
misconfigured instance from silently querying the wrong source (e.g. after 
someone adds a second dedicated binding, a "pick the first" regression would go 
unnoticed). This adds two tests: two dedicated sources bound to the same 
instance, and two dedicated plus one shared source (the shared fallback must 
not rescue that case).
   
   Base is `rocketmq-studio` per CONTRIBUTING.md (the PR template's base 
comment is outdated).
   
   ### How Did You Test This Change?
   
   `cd server && mvn -B -ntp -Dtest=MetricsServiceTest test` — 31/31 pass 
(`Tests run: 31, Failures: 0, Errors: 0, Skipped: 0`, BUILD SUCCESS), including 
the two new tests, both asserting 409 and no interaction with 
`metricsSourceFactory` / the metrics source. No production code changed.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`test:`)
   - [x] Tests added or updated for non-trivial changes (this PR is the tests)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(n/a — no UI change)
   - [x] Architecture constraints stay green (test-only change; class under 
test untouched)
   - [x] New source files carry the ASF license header (n/a — no new source 
file)
   - [x] Documentation touched where behaviour changed (n/a — behaviour 
unchanged)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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