diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java index e390e581206..e1024f91068 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java @@ -16,6 +16,7 @@ package com.google.cloud.spanner; +import static io.grpc.Grpc.TRANSPORT_ATTR_REMOTE_ADDR; import static org.junit.Assert.assertEquals; import com.google.cloud.NoCredentials; @@ -134,7 +135,7 @@ public ServerCall.Listener interceptCall( Attributes.Key key = (Attributes.Key) attributes.keys().stream() - .filter(k -> k.toString().equals("remote-addr")) + .filter(k -> k.equals(TRANSPORT_ATTR_REMOTE_ADDR)) .findFirst() .orElse(null); if (key != null) {