xds: fix bug of verifying xDS requests with ordered resource names

Use matcher that takes care of resource name ordering for comparing requests.
This commit is contained in:
Chengyuan Zhang 2019-12-09 16:39:26 -08:00 committed by GitHub
parent e66ab4e63b
commit 942c1c6b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1474,9 +1474,10 @@ public class XdsClientImplTest {
// Client sent a new CDS request for all interested resources.
verify(requestObserver)
.onNext(
eq(buildDiscoveryRequest(NODE, "0",
ImmutableList.of("cluster-foo.googleapis.com", "cluster-bar.googleapis.com"),
XdsClientImpl.ADS_TYPE_URL_CDS, "0000")));
argThat(
new DiscoveryRequestMatcher("0",
ImmutableList.of("cluster-foo.googleapis.com", "cluster-bar.googleapis.com"),
XdsClientImpl.ADS_TYPE_URL_CDS, "0000")));
// Management server sends back a CDS response with Cluster for all requested cluster.
clusters = ImmutableList.of(