core: add getCallOptions() to CallCredentials.RequestInfo (#9538)

This is needed internally (b/134067789#comment20).
This commit is contained in:
Kun Zhang 2022-09-13 08:55:05 -07:00 committed by GitHub
parent 9853a0c463
commit 38b338228a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -91,6 +91,13 @@ public abstract class CallCredentials {
*/
public abstract MethodDescriptor<?, ?> getMethodDescriptor();
/**
* The call options used to call this RPC.
*/
public CallOptions getCallOptions() {
throw new UnsupportedOperationException("Not implemented");
}
/**
* The security level on the transport.
*/

View File

@ -127,6 +127,11 @@ final class CallCredentialsApplyingTransportFactory implements ClientTransportFa
return method;
}
@Override
public CallOptions getCallOptions() {
return callOptions;
}
@Override
public SecurityLevel getSecurityLevel() {
return firstNonNull(

View File

@ -148,6 +148,7 @@ public class CallCredentialsApplyingTest {
RequestInfo info = infoCaptor.getValue();
assertSame(transportAttrs, info.getTransportAttrs());
assertSame(method, info.getMethodDescriptor());
assertSame(callOptions, info.getCallOptions());
assertSame(AUTHORITY, info.getAuthority());
assertSame(SecurityLevel.NONE, info.getSecurityLevel());
}