xds: fix lint warnings in test code (#6559)

This commit is contained in:
Kun Zhang 2019-12-27 11:14:51 -08:00 committed by Jihun Cho
parent 90969b3471
commit d227520388
1 changed files with 18 additions and 14 deletions

View File

@ -374,12 +374,12 @@ public class XdsNameResolverTest {
} }
/** /**
* Builds an LDS DiscoveryResponse containing the mapping of given host name (with port if any) * Builds an LDS DiscoveryResponse containing the mapping of given host name (with port if any) to
* to the given cluster name directly in-line. Clients receiving this response is able to * the given cluster name directly in-line. Clients receiving this response is able to resolve
* resolve cluster name for the given hostname:port immediately. * cluster name for the given hostname:port immediately.
*/ */
private DiscoveryResponse buildLdsResponseForCluster(String versionInfo, private static DiscoveryResponse buildLdsResponseForCluster(
String hostName, int port, String clusterName, String nonce) { String versionInfo, String hostName, int port, String clusterName, String nonce) {
String ldsResourceName = port == -1 ? hostName : hostName + ":" + port; String ldsResourceName = port == -1 ? hostName : hostName + ":" + port;
List<Any> listeners = ImmutableList.of( List<Any> listeners = ImmutableList.of(
Any.pack(buildListener(ldsResourceName, Any.pack(buildListener(ldsResourceName,
@ -396,12 +396,12 @@ public class XdsNameResolverTest {
} }
/** /**
* Builds an LDS DiscoveryResponse containing the mapping of given host name (with port if any) * Builds an LDS DiscoveryResponse containing the mapping of given host name (with port if any) to
* to the given RDS resource name. Clients receiving this response is able to send an RDS * the given RDS resource name. Clients receiving this response is able to send an RDS request for
* request for resolving the cluster name for the given hostname:port. * resolving the cluster name for the given hostname:port.
*/ */
private DiscoveryResponse buildLdsResponseForRdsResource(String versionInfo, private static DiscoveryResponse buildLdsResponseForRdsResource(
String hostName, int port, String routeConfigName, String nonce) { String versionInfo, String hostName, int port, String routeConfigName, String nonce) {
String ldsResourceName = port == -1 ? hostName : hostName + ":" + port; String ldsResourceName = port == -1 ? hostName : hostName + ":" + port;
Rds rdsConfig = Rds rdsConfig =
Rds.newBuilder() Rds.newBuilder()
@ -418,11 +418,15 @@ public class XdsNameResolverTest {
} }
/** /**
* Builds an RDS DiscoveryResponse containing the mapping of given route config name to the * Builds an RDS DiscoveryResponse containing the mapping of given route config name to the given
* given cluster name under. * cluster name under.
*/ */
private DiscoveryResponse buildRdsResponseForCluster(String versionInfo, private static DiscoveryResponse buildRdsResponseForCluster(
String routeConfigName, String hostName, String clusterName, String nonce) { String versionInfo,
String routeConfigName,
String hostName,
String clusterName,
String nonce) {
List<Any> routeConfigs = ImmutableList.of( List<Any> routeConfigs = ImmutableList.of(
Any.pack( Any.pack(
buildRouteConfiguration( buildRouteConfiguration(