aboutsummaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorKun Zhang <zhangkun83@users.noreply.github.com>2018-10-10 21:45:56 -0700
committerGitHub <noreply@github.com>2018-10-10 21:45:56 -0700
commit861f9147ed13e3956fe27b2a86288063558c2e94 (patch)
tree1b58b07fce7815db541aafa335a12dfc246c0691 /testing
parent4ce9c0492d0d03731d7ab8023f95ea562ee0d5e2 (diff)
downloadgrpc-grpc-java-861f9147ed13e3956fe27b2a86288063558c2e94.tar.gz
core: add CallCredentials2 and deprecate CallCredentials' old interface (#4902)
This is the first step of smoothly changing the CallCredentials API. Security level and authority are parameters required to be passed to applyRequestMetadata(). This change wraps them, along with MethodDescriptor and the transport attributes to RequestInfo, which is more clear to the implementers. ATTR_SECURITY_LEVEL is moved to the internal GrpcAttributes and annotated as TransportAttr, because transports are required to set it, but no user is actually reading them from {Client,Server}Call.getAttributes(). ATTR_AUTHORITY is removed, because no transport is overriding it. All involved interfaces are changed to abstract classes, as this will make further API changes smoother. The CallCredentials name is stabilized, thus we first introduce CallCredentials2, ask CallCredentials implementations to migrate to it, while GRPC accepting both at the same time, then replace CallCredentials with CallCredentials2.
Diffstat (limited to 'testing')
-rw-r--r--testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java b/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java
index 4a37729f6..19f5e1f68 100644
--- a/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java
+++ b/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java
@@ -44,7 +44,6 @@ import com.google.common.collect.Lists;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import io.grpc.Attributes;
-import io.grpc.CallCredentials;
import io.grpc.CallOptions;
import io.grpc.ClientStreamTracer;
import io.grpc.Grpc;
@@ -59,6 +58,7 @@ import io.grpc.internal.ClientStream;
import io.grpc.internal.ClientStreamListener;
import io.grpc.internal.ClientTransport;
import io.grpc.internal.ConnectionClientTransport;
+import io.grpc.internal.GrpcAttributes;
import io.grpc.internal.InternalServer;
import io.grpc.internal.IoUtils;
import io.grpc.internal.ManagedClientTransport;
@@ -346,7 +346,7 @@ public abstract class AbstractTransportTest {
verify(mockClientTransportListener, timeout(TIMEOUT_MS)).transportReady();
assertNotNull("security level should be set in client attributes",
- connectionClient.getAttributes().get(CallCredentials.ATTR_SECURITY_LEVEL));
+ connectionClient.getAttributes().get(GrpcAttributes.ATTR_SECURITY_LEVEL));
}
@Test