Skip to content

Commit

Permalink
renaming client and server handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
janardhankrishna-sai committed Dec 20, 2024
1 parent 924a9e7 commit ecdab23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions authz/grpc_authz_end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (s) TestStaticPolicyEnd2End(t *testing.T) {
UnaryCallF: func(ctx context.Context, req *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
return &testpb.SimpleResponse{}, nil
},
ClientStreamingInputCall: func(stream testgrpc.TestService_StreamingInputCallServer) error {
StreamingInputCallF: func(stream testgrpc.TestService_StreamingInputCallServer) error {
for {
_, err := stream.Recv()
if err == io.EOF {
Expand Down Expand Up @@ -518,7 +518,7 @@ func (s) TestFileWatcherEnd2End(t *testing.T) {
UnaryCallF: func(ctx context.Context, req *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
return &testpb.SimpleResponse{}, nil
},
ClientStreamingInputCall: func(stream testgrpc.TestService_StreamingInputCallServer) error {
StreamingInputCallF: func(stream testgrpc.TestService_StreamingInputCallServer) error {
for {
_, err := stream.Recv()
if err == io.EOF {
Expand Down
14 changes: 7 additions & 7 deletions internal/stubserver/stubserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ type StubServer struct {
testgrpc.TestServiceServer

// Customizable implementations of server handlers.
EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error)
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error)
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error
ClientStreamingInputCall func(stream testgrpc.TestService_StreamingInputCallServer) error
ClientStreamingOutputCall func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error
EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error)
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error)
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error
StreamingInputCallF func(stream testgrpc.TestService_StreamingInputCallServer) error // ClientStreaming
StreamingOutputCallF func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error // ServerStreaming

// A client connected to this service the test may use. Created in Start().
Client testgrpc.TestServiceClient
Expand Down Expand Up @@ -105,12 +105,12 @@ func (ss *StubServer) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallS

// StreamingInputCall is the handler for testpb.StreamingInputCall
func (ss *StubServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error {
return ss.ClientStreamingInputCall(stream)
return ss.StreamingInputCallF(stream)
}

// StreamingOutputCall is the handler for testpb.StreamingOutputCall
func (ss *StubServer) StreamingOutputCall(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error {
return ss.ClientStreamingOutputCall(req, stream)
return ss.StreamingOutputCallF(req, stream)

Check warning on line 113 in internal/stubserver/stubserver.go

View check run for this annotation

Codecov / codecov/patch

internal/stubserver/stubserver.go#L112-L113

Added lines #L112 - L113 were not covered by tests
}

// Start starts the server and creates a client connected to it.
Expand Down

0 comments on commit ecdab23

Please sign in to comment.