diff --git a/integration_tests/mongo/main.go b/integration_tests/mongo/main.go index 8581705a..8ecb031e 100644 --- a/integration_tests/mongo/main.go +++ b/integration_tests/mongo/main.go @@ -169,12 +169,12 @@ func testTypes(ctx context.Context, db *mongo.Database, mongoCfg config.MongoDB) return fmt.Errorf("failed to get event from bytes: %w", err) } - pkMap, err := dbz.GetPrimaryKey(actualPkBytes, &kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) + pkMap, err := dbz.GetPrimaryKey(actualPkBytes, kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) if err != nil { return fmt.Errorf("failed to get primary key: %w", err) } - data, err := evt.GetData(pkMap, &kafkalib.TopicConfig{}) + data, err := evt.GetData(pkMap, kafkalib.TopicConfig{}) if err != nil { return fmt.Errorf("failed to get data: %w", err) } diff --git a/lib/mongo/message_test.go b/lib/mongo/message_test.go index 78317dd5..b0f32f02 100644 --- a/lib/mongo/message_test.go +++ b/lib/mongo/message_test.go @@ -31,7 +31,7 @@ func TestParseMessagePartitionKey(t *testing.T) { assert.NoError(t, err) var dbz transferMongo.Debezium - pkMap, err := dbz.GetPrimaryKey(rawMsgBytes, &kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) + pkMap, err := dbz.GetPrimaryKey(rawMsgBytes, kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) assert.NoError(t, err) assert.Equal(t, "507f1f77bcf86cd799439011", pkMap["_id"]) } @@ -88,7 +88,7 @@ func TestParseMessage(t *testing.T) { assert.NoError(t, err) var dbz transferMongo.Debezium - pkMap, err := dbz.GetPrimaryKey(rawPkBytes, &kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) + pkMap, err := dbz.GetPrimaryKey(rawPkBytes, kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}) assert.NoError(t, err) rawMsgBytes, err := json.Marshal(rawMsg.Event()) @@ -111,7 +111,7 @@ func TestParseMessage(t *testing.T) { "nullValue": nil, } - actualKVMap, err := kvMap.GetData(pkMap, &kafkalib.TopicConfig{}) + actualKVMap, err := kvMap.GetData(pkMap, kafkalib.TopicConfig{}) assert.NoError(t, err) for expectedKey, expectedVal := range expectedMap { actualVal, isOk := actualKVMap[expectedKey] diff --git a/writers/transfer/writer_test.go b/writers/transfer/writer_test.go index 0618a2c1..7617d712 100644 --- a/writers/transfer/writer_test.go +++ b/writers/transfer/writer_test.go @@ -29,12 +29,8 @@ func TestWriter_MessageToEvent(t *testing.T) { assert.NoError(t, err) writer := Writer{ - cfg: transferCfg.Config{ - SharedTransferConfig: transferCfg.SharedTransferConfig{}, - }, - tc: &kafkalib.TopicConfig{ - CDCKeyFormat: kafkalib.JSONKeyFmt, - }, + cfg: transferCfg.Config{SharedTransferConfig: transferCfg.SharedTransferConfig{}}, + tc: kafkalib.TopicConfig{CDCKeyFormat: kafkalib.JSONKeyFmt}, } evtOut, err := writer.messageToEvent(message)