@@ -9,32 +9,32 @@ import (
99 "testing"
1010
1111 "github.com/pkg/errors"
12- "google.golang.org/grpc/codes"
13-
1412 "github.com/stretchr/testify/assert"
1513 "github.com/stretchr/testify/require"
1614 "golang.org/x/sync/errgroup"
1715 "google.golang.org/grpc"
18- "google.golang.org/grpc/examples/helloworld/helloworld "
16+ "google.golang.org/grpc/codes "
1917 "google.golang.org/grpc/status"
18+
19+ "github.com/ory/herodot/internal"
2020)
2121
2222type testingGreeter struct {
23- helloworld .UnimplementedGreeterServer
23+ internal .UnimplementedGreeterServer
2424 shouldErr bool
2525}
2626
27- func (g * testingGreeter ) SayHello (context.Context , * helloworld .HelloRequest ) (* helloworld .HelloReply , error ) {
27+ func (g * testingGreeter ) SayHello (context.Context , * internal .HelloRequest ) (* internal .HelloReply , error ) {
2828 if g .shouldErr {
2929 return nil , errors .WithStack (ErrInternalServerError )
3030 }
31- return & helloworld .HelloReply {Message : "see, no error" }, nil
31+ return & internal .HelloReply {Message : "see, no error" }, nil
3232}
3333
3434func TestGRPCInterceptors (t * testing.T ) {
3535 server := & testingGreeter {}
3636 s := grpc .NewServer (grpc .UnaryInterceptor (UnaryErrorUnwrapInterceptor ))
37- helloworld .RegisterGreeterServer (s , server )
37+ internal .RegisterGreeterServer (s , server )
3838 l , err := net .Listen ("tcp" , "127.0.0.1:0" )
3939 require .NoError (t , err )
4040
@@ -45,7 +45,7 @@ func TestGRPCInterceptors(t *testing.T) {
4545
4646 conn , err := grpc .Dial (l .Addr ().String (), grpc .WithInsecure ())
4747 require .NoError (t , err )
48- c := helloworld .NewGreeterClient (conn )
48+ c := internal .NewGreeterClient (conn )
4949
5050 for _ , tc := range []struct {
5151 name string
@@ -63,7 +63,7 @@ func TestGRPCInterceptors(t *testing.T) {
6363 t .Run ("case=" + tc .name , func (t * testing.T ) {
6464 server .shouldErr = tc .shouldErr
6565
66- resp , err := c .SayHello (context .Background (), & helloworld .HelloRequest {})
66+ resp , err := c .SayHello (context .Background (), & internal .HelloRequest {})
6767 if tc .shouldErr {
6868 assert .Equal (t , codes .Internal , status .Code (err ))
6969 } else {
0 commit comments