Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Assert Package 3/3 #1205

Merged
merged 12 commits into from
Sep 19, 2023
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/extractfield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"reflect"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/matryer/is"
)

func TestExtractFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -68,6 +68,8 @@ func TestExtractFieldKey_Build(t *testing.T) {
}

func TestExtractFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -135,7 +137,7 @@ func TestExtractFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := ExtractFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
AdamHaffar marked this conversation as resolved.
Show resolved Hide resolved
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -191,6 +193,8 @@ func TestExtractFieldPayload_Build(t *testing.T) {
}

func TestExtractFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -273,7 +277,7 @@ func TestExtractFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := ExtractFieldPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/filterfield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/google/go-cmp/cmp"
"github.com/matryer/is"
)

func TestFilterFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -101,6 +101,8 @@ func TestFilterFieldKey_Build(t *testing.T) {
}

func TestFilterFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -231,7 +233,7 @@ func TestFilterFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := FilterFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("FilterFieldKey() error = %v, wantErr %v", err, tt.wantErr)
Expand Down Expand Up @@ -316,6 +318,8 @@ func TestFilterFieldPayload_Build(t *testing.T) {
}

func TestFilterFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
config processor.Config
r record.Record
Expand Down Expand Up @@ -421,7 +425,7 @@ func TestFilterFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := FilterFieldPayload(tt.args.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != (tt.err != nil) {
t.Errorf("FilterFieldPayload Error: %s - wanted: %s", err, tt.err)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/hoistfield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"reflect"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/matryer/is"
)

func TestHoistFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -69,6 +69,8 @@ func TestHoistFieldKey_Build(t *testing.T) {
}

func TestHoistFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -132,7 +134,7 @@ func TestHoistFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := HoistFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -189,6 +191,8 @@ func TestHoistFieldPayload_Build(t *testing.T) {
}

func TestHoistFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -267,7 +271,7 @@ func TestHoistFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := HoistFieldPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/insertfield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"reflect"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/matryer/is"
)

func TestInsertFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -82,6 +82,8 @@ func TestInsertFieldKey_Build(t *testing.T) {
}

func TestInsertFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -244,7 +246,7 @@ func TestInsertFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := InsertFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -312,6 +314,8 @@ func TestInsertFieldPayload_Build(t *testing.T) {
}

func TestInsertFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -503,7 +507,7 @@ func TestInsertFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := InsertFieldPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/maskfield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/google/go-cmp/cmp"
"github.com/matryer/is"
)

func TestMaskFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -68,6 +68,8 @@ func TestMaskFieldKey_Build(t *testing.T) {
}

func TestMaskFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -160,7 +162,7 @@ func TestMaskFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := MaskFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -216,6 +218,8 @@ func TestMaskFieldPayload_Build(t *testing.T) {
}

func TestMaskFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -332,7 +336,7 @@ func TestMaskFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := MaskFieldPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/replacefield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/google/go-cmp/cmp"
"github.com/matryer/is"
)

func TestReplaceFieldKey_Build(t *testing.T) {
Expand Down Expand Up @@ -108,6 +108,8 @@ func TestReplaceFieldKey_Build(t *testing.T) {
}

func TestReplaceFieldKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -292,7 +294,7 @@ func TestReplaceFieldKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := ReplaceFieldKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -389,6 +391,8 @@ func TestReplaceFieldPayload_Build(t *testing.T) {
}

func TestReplaceFieldPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -621,7 +625,7 @@ func TestReplaceFieldPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := ReplaceFieldPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
10 changes: 7 additions & 3 deletions pkg/processor/procbuiltin/timestampconverter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
"testing"
"time"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/google/go-cmp/cmp"
"github.com/matryer/is"
)

func TestTimestampConverterKey_Build(t *testing.T) {
Expand Down Expand Up @@ -101,6 +101,8 @@ func TestTimestampConverterKey_Build(t *testing.T) {
}

func TestTimestampConverterKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -298,7 +300,7 @@ func TestTimestampConverterKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := TimestampConverterKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down Expand Up @@ -357,6 +359,8 @@ func TestTimestampConverterPayload_Build(t *testing.T) {
}

func TestTimestampConverterPayload_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -601,7 +605,7 @@ func TestTimestampConverterPayload_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := TimestampConverterPayload(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
6 changes: 4 additions & 2 deletions pkg/processor/procbuiltin/valuetokey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"reflect"
"testing"

"github.com/conduitio/conduit/pkg/foundation/assert"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/conduitio/conduit/pkg/record/schema/mock"
"github.com/matryer/is"
)

func TestValueToKey_Build(t *testing.T) {
Expand Down Expand Up @@ -68,6 +68,8 @@ func TestValueToKey_Build(t *testing.T) {
}

func TestValueToKey_Process(t *testing.T) {
is := is.New(t)

type args struct {
r record.Record
}
Expand Down Expand Up @@ -140,7 +142,7 @@ func TestValueToKey_Process(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
underTest, err := ValueToKey(tt.config)
assert.Ok(t, err)
is.NoErr(err)
got, err := underTest.Process(context.Background(), tt.args.r)
if (err != nil) != tt.wantErr {
t.Errorf("process() error = %v, wantErr = %v", err, tt.wantErr)
Expand Down
Loading
Loading