Skip to content

Commit 9d4fa67

Browse files
transport_test: change testgrpc.Emtpy to testpb.Empty (#8040)
1 parent 2fd426d commit 9d4fa67

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

internal/transport/proxy_ext_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"google.golang.org/grpc/internal/testutils"
3939
"google.golang.org/grpc/internal/testutils/proxyserver"
4040
testgrpc "google.golang.org/grpc/interop/grpc_testing"
41+
testpb "google.golang.org/grpc/interop/grpc_testing"
4142
"google.golang.org/grpc/resolver"
4243
"google.golang.org/grpc/resolver/manual"
4344
)
@@ -55,7 +56,7 @@ func Test(t *testing.T) {
5556
func startBackendServer(t *testing.T) *stubserver.StubServer {
5657
t.Helper()
5758
backend := &stubserver.StubServer{
58-
EmptyCallF: func(context.Context, *testgrpc.Empty) (*testgrpc.Empty, error) { return &testgrpc.Empty{}, nil },
59+
EmptyCallF: func(context.Context, *testpb.Empty) (*testpb.Empty, error) { return &testpb.Empty{}, nil },
5960
}
6061
if err := backend.StartServer(); err != nil {
6162
t.Fatalf("failed to start backend: %v", err)
@@ -119,7 +120,7 @@ func (s) TestGRPCDialWithProxy(t *testing.T) {
119120

120121
// Send an empty RPC to the backend through the proxy.
121122
client := testgrpc.NewTestServiceClient(conn)
122-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
123+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
123124
t.Fatalf("EmptyCall failed: %v", err)
124125
}
125126

@@ -176,7 +177,7 @@ func (s) TestGRPCDialWithDNSAndProxy(t *testing.T) {
176177

177178
// Send an empty RPC to the backend through the proxy.
178179
client := testgrpc.NewTestServiceClient(conn)
179-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
180+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
180181
t.Fatalf("EmptyCall failed: %v", err)
181182
}
182183

@@ -235,7 +236,7 @@ func (s) TestNewClientWithProxy(t *testing.T) {
235236

236237
// Send an empty RPC to the backend through the proxy.
237238
client := testgrpc.NewTestServiceClient(conn)
238-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
239+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
239240
t.Fatalf("EmptyCall failed: %v", err)
240241
}
241242
if !proxyCalled {
@@ -295,7 +296,7 @@ func (s) TestNewClientWithProxyAndCustomResolver(t *testing.T) {
295296

296297
// Send an empty RPC to the backend through the proxy.
297298
client := testgrpc.NewTestServiceClient(conn)
298-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
299+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
299300
t.Fatalf("EmptyCall() failed: %v", err)
300301
}
301302

@@ -351,7 +352,7 @@ func (s) TestNewClientWithProxyAndTargetResolutionEnabled(t *testing.T) {
351352

352353
// Send an empty RPC to the backend through the proxy.
353354
client := testgrpc.NewTestServiceClient(conn)
354-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
355+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
355356
t.Fatalf("EmptyCall failed: %v", err)
356357
}
357358

@@ -400,7 +401,7 @@ func (s) TestNewClientWithNoProxy(t *testing.T) {
400401

401402
// Create a test service client and make an RPC call.
402403
client := testgrpc.NewTestServiceClient(conn)
403-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
404+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
404405
t.Fatalf("EmptyCall() failed: %v", err)
405406
}
406407
}
@@ -449,7 +450,7 @@ func (s) TestNewClientWithContextDialer(t *testing.T) {
449450
defer conn.Close()
450451

451452
client := testgrpc.NewTestServiceClient(conn)
452-
if _, err := client.EmptyCall(ctx, &testgrpc.Empty{}); err != nil {
453+
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil {
453454
t.Fatalf("EmptyCall() failed: %v", err)
454455
}
455456
}
@@ -510,7 +511,7 @@ func (s) TestBasicAuthInNewClientWithProxy(t *testing.T) {
510511

511512
// Send an empty RPC to the backend through the proxy.
512513
client := testgrpc.NewTestServiceClient(conn)
513-
client.EmptyCall(ctx, &testgrpc.Empty{})
514+
client.EmptyCall(ctx, &testpb.Empty{})
514515

515516
if !proxyCalled {
516517
t.Fatalf("Proxy not connected")

0 commit comments

Comments
 (0)