Skip to content

Commit

Permalink
rename streamService (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: Lovro Mažgon <lovro.mazgon@gmail.com>
  • Loading branch information
maha-hajja and lovromazgon authored May 23, 2023
1 parent a45eea7 commit 0c86fac
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 171 deletions.
4 changes: 2 additions & 2 deletions destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Destination struct {

config Config
conn *grpc.ClientConn
stream pb.StreamService_StreamClient
stream pb.SourceService_StreamClient

// for testing: always empty, unless it's a test
dialer func(ctx context.Context, _ string) (net.Conn, error)
Expand Down Expand Up @@ -91,7 +91,7 @@ func (d *Destination) Open(ctx context.Context) error {
d.conn = conn

// create the client
client := pb.NewStreamServiceClient(conn)
client := pb.NewSourceServiceClient(conn)
// call the Stream method to create a bidirectional streaming RPC stream
d.stream, err = client.Stream(ctx)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions destination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ func startTestServer(t *testing.T, lis net.Listener, expected []sdk.Record) {
srv := grpc.NewServer()

// create and register simple mock server
mockServer := pb.NewMockStreamServiceServer(ctrl)
mockServer := pb.NewMockSourceServiceServer(ctrl)
mockServer.EXPECT().
Stream(gomock.Any()).
DoAndReturn(
func(stream pb.StreamService_StreamServer) error {
func(stream pb.SourceService_StreamServer) error {
i := 0
for {
// read from the stream to simulate receiving data from the client
Expand Down Expand Up @@ -134,7 +134,7 @@ func startTestServer(t *testing.T, lis net.Listener, expected []sdk.Record) {
}
},
)
pb.RegisterStreamServiceServer(srv, mockServer)
pb.RegisterSourceServiceServer(srv, mockServer)

// start gRPC server
var wg sync.WaitGroup
Expand Down
Loading

0 comments on commit 0c86fac

Please sign in to comment.