fix: remove deprecated dependencies (#1837)

* fix: remove deprecated dependencies

* backup

* fix test error
This commit is contained in:
Kevin Wan
2022-04-27 21:34:54 +08:00
committed by GitHub
parent c3a49ece8d
commit f7a60cdc24
11 changed files with 154 additions and 53 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/zeromicro/go-zero/zrpc/internal/mock"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"
"google.golang.org/grpc/test/bufconn"
)
@@ -103,14 +104,15 @@ func TestDepositServer_Deposit(t *testing.T) {
Token: "bar",
Timeout: 1000,
},
WithDialOption(grpc.WithInsecure()),
WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())),
WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},
cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
return invoker(ctx, method, req, reply, cc, opts...)
}),
)
targetClient, err := NewClientWithTarget("foo", WithDialOption(grpc.WithInsecure()),
targetClient, err := NewClientWithTarget("foo",
WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())), WithUnaryClientInterceptor(
func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn,
invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
@@ -162,7 +164,7 @@ func TestNewClientWithError(t *testing.T) {
Token: "bar",
Timeout: 1000,
},
WithDialOption(grpc.WithInsecure()),
WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())),
WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},
cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
@@ -181,7 +183,7 @@ func TestNewClientWithError(t *testing.T) {
Token: "bar",
Timeout: 1,
},
WithDialOption(grpc.WithInsecure()),
WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())),
WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},
cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {