feat: support WithStreamClientInterceptor for zrpc clients (#1907)
* feat: support WithStreamClientInterceptor for zrpc clients * fix: data race
This commit is contained in:
@@ -31,6 +31,17 @@ func TestWithNonBlock(t *testing.T) {
|
||||
assert.True(t, options.NonBlock)
|
||||
}
|
||||
|
||||
func TestWithStreamClientInterceptor(t *testing.T) {
|
||||
var options ClientOptions
|
||||
opt := WithStreamClientInterceptor(func(ctx context.Context, desc *grpc.StreamDesc,
|
||||
cc *grpc.ClientConn, method string, streamer grpc.Streamer,
|
||||
opts ...grpc.CallOption) (grpc.ClientStream, error) {
|
||||
return nil, nil
|
||||
})
|
||||
opt(&options)
|
||||
assert.Equal(t, 1, len(options.DialOptions))
|
||||
}
|
||||
|
||||
func TestWithTransportCredentials(t *testing.T) {
|
||||
var options ClientOptions
|
||||
opt := WithTransportCredentials(nil)
|
||||
|
||||
Reference in New Issue
Block a user