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

@@ -9,6 +9,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"
)
@@ -36,7 +37,7 @@ func TestProxy(t *testing.T) {
},
}
proxy := NewProxy("foo", WithDialOption(grpc.WithInsecure()),
proxy := NewProxy("foo", WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithContextDialer(dialer())))
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -66,7 +67,8 @@ func TestProxy(t *testing.T) {
}
func TestRpcProxy_TakeConnNewClientFailed(t *testing.T) {
proxy := NewProxy("foo", WithDialOption(grpc.WithInsecure()), WithDialOption(grpc.WithBlock()))
proxy := NewProxy("foo", WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())),
WithDialOption(grpc.WithBlock()))
_, err := proxy.TakeConn(context.Background())
assert.NotNil(t, err)
}