mirror of https://github.com/grpc/grpc-java.git
interop-testing: Avoid alts incompatibility with netty
alts requires netty-shaded, not netty.
This commit is contained in:
parent
5c59fd2b1a
commit
0203256171
|
|
@ -396,9 +396,10 @@ public class TestServiceClient {
|
|||
private class Tester extends AbstractInteropTest {
|
||||
@Override
|
||||
protected ManagedChannelBuilder<?> createChannelBuilder() {
|
||||
boolean useGeneric = false;
|
||||
ChannelCredentials channelCredentials;
|
||||
if (customCredentialsType != null) {
|
||||
useOkHttp = false; // Retain old behavior; avoids erroring if incompatible
|
||||
useGeneric = true; // Retain old behavior; avoids erroring if incompatible
|
||||
if (customCredentialsType.equals("google_default_credentials")) {
|
||||
channelCredentials = GoogleDefaultChannelCredentials.create();
|
||||
} else if (customCredentialsType.equals("compute_engine_channel_creds")) {
|
||||
|
|
@ -409,7 +410,7 @@ public class TestServiceClient {
|
|||
}
|
||||
|
||||
} else if (useAlts) {
|
||||
useOkHttp = false; // Retain old behavior; avoids erroring if incompatible
|
||||
useGeneric = true; // Retain old behavior; avoids erroring if incompatible
|
||||
channelCredentials = AltsChannelCredentials.create();
|
||||
|
||||
} else if (useTls) {
|
||||
|
|
@ -442,6 +443,14 @@ public class TestServiceClient {
|
|||
channelCredentials = InsecureChannelCredentials.create();
|
||||
}
|
||||
}
|
||||
if (useGeneric) {
|
||||
ManagedChannelBuilder<?> channelBuilder =
|
||||
Grpc.newChannelBuilderForAddress(serverHost, serverPort, channelCredentials);
|
||||
if (serverHostOverride != null) {
|
||||
channelBuilder.overrideAuthority(serverHostOverride);
|
||||
}
|
||||
return channelBuilder;
|
||||
}
|
||||
if (!useOkHttp) {
|
||||
NettyChannelBuilder nettyBuilder =
|
||||
NettyChannelBuilder.forAddress(serverHost, serverPort, channelCredentials)
|
||||
|
|
|
|||
Loading…
Reference in New Issue