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

   ### Problem
   
   `ApacheWriteTargetResolver` — the guard that decides which physical cluster 
a write may touch — had **no test**. Its class contract is one sentence: *a 
write target must come from trusted ownership or a unique topology; never guess 
the physical cluster from the instance name.*
   
   ### Change
   
   Add `ApacheWriteTargetResolverTest` with thirteen tests pinning every branch 
of that contract:
   
   | Path | Pinned behaviour |
   | --- | --- |
   | trusted ownership | `ownedCluster` wins outright |
   | virtual instance (no id) | without ownedCluster becomes the cluster by its 
own name; a virtual name **disagreeing** with the owned cluster is rejected 409 
— never guess |
   | registered instance without ownedCluster | rejected 409 on 
**multi-cluster** endpoints; takes the unique cluster on single-cluster 
endpoints — including the broker-table consistency check on that path (a broker 
claiming another cluster breaks uniqueness) |
   | incomplete topology | null tables / empty cluster table rejected up front |
   | `target()` | a cluster missing from the table; an **extra broker claiming 
the cluster** outside the cluster-table name set; a broker without a master 
address — each rejected 409 |
   | `requireTopicRoute()` | a route reaching a broker outside the target 
cluster rejected (the SDK must not fan out on its own); a fully contained route 
passes |
   
   ### Verification
   
   - New tests: **13/13 green** against unmodified code.
   - Discriminating mutations on the resolver (build result verified): 
virtual-name agreement check dropped (**red**); multi-cluster guard dropped 
(**red**); cross-table scan dropped (**red**); route containment check dropped 
(**red**).
   - Restored: 13/13 green. No product code changed.


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