Skip to content

Commit 7b4ea0b

Browse files
committed
removing function and moving logic into HandshakerServiceChannel
1 parent f2eb129 commit 7b4ea0b

File tree

3 files changed

+2
-51
lines changed

3 files changed

+2
-51
lines changed

alts/src/main/java/io/grpc/alts/HandshakerServiceChannel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.grpc.alts;
1818

19+
import com.google.common.base.MoreObjects;
1920
import io.grpc.CallOptions;
2021
import io.grpc.Channel;
2122
import io.grpc.ClientCall;
@@ -39,7 +40,7 @@
3940
final class HandshakerServiceChannel {
4041

4142
static final Resource<Channel> SHARED_HANDSHAKER_CHANNEL =
42-
new ChannelResource(MetadataServerAddressUtil.getHandshakerAddress());
43+
new ChannelResource(MoreObjects.firstNonNull(System.getenv("GCE_METADATA_HOST"), "metadata.google.internal.:8080"));
4344

4445

4546
/** Returns a resource of handshaker service channel for testing only. */

alts/src/main/java/io/grpc/alts/MetadataServerAddressUtil.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

alts/src/test/java/io/grpc/alts/HandshakerServiceChannelTest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,6 @@ public void setUp() throws Exception {
5656
HandshakerServiceChannel.getHandshakerChannelForTesting("localhost:" + server.getPort());
5757
}
5858

59-
@Test
60-
public void handshakerAddress_default() {
61-
assertThat(MetadataServerAddressUtil.getHandshakerAddress())
62-
.isEqualTo("metadata.google.internal.:8080");
63-
}
64-
65-
@Test
66-
public void handshakerAddress_withEnvVar() {
67-
if (MetadataServerAddressUtil.TEST_METADATA_HOST_ENV_VAR != null ) {
68-
assertThat(MetadataServerAddressUtil.getHandshakerAddress())
69-
.isEqualTo(MetadataServerAddressUtil.TEST_METADATA_HOST_ENV_VAR);
70-
}
71-
}
7259

7360
@Test
7461
public void sharedChannel_authority() {

0 commit comments

Comments
 (0)