Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso committed Nov 5, 2024
1 parent 20ef676 commit 37f0b88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func TestSourceWithSchemaExtraction_Read(t *testing.T) {

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
src.EXPECT().Read(ctx).Return(tc.record, nil)
src.EXPECT().ReadN(ctx, 1).Return([]opencdc.Record{tc.record}, nil)

var wantKey, wantPayloadBefore, wantPayloadAfter opencdc.Data
if tc.record.Key != nil {
Expand All @@ -375,9 +375,11 @@ func TestSourceWithSchemaExtraction_Read(t *testing.T) {
wantPayloadAfter = tc.record.Payload.After.Clone()
}

got, err := s.Read(ctx)
gotN, err := s.ReadN(ctx, 1)
is.NoErr(err)
is.Equal(1, len(gotN))

got := gotN[0]
gotKey := got.Key
gotPayloadBefore := got.Payload.Before
gotPayloadAfter := got.Payload.After
Expand Down

0 comments on commit 37f0b88

Please sign in to comment.