diff --git a/models/event/event_test.go b/models/event/event_test.go index cec3ae2b1..05ba43cac 100644 --- a/models/event/event_test.go +++ b/models/event/event_test.go @@ -58,6 +58,12 @@ func (e *EventsTestSuite) TestEvent_IsValid() { } func (e *EventsTestSuite) TestEvent_TableName() { + { + // Don't pass in tableName. + evt, err := ToMemoryEvent(e.fakeEvent, idMap, &kafkalib.TopicConfig{}, config.Replication) + assert.NoError(e.T(), err) + assert.Equal(e.T(), e.fakeEvent.GetTableName(), evt.Table) + } { // Now pass it in, it should override. evt, err := ToMemoryEvent(e.fakeEvent, idMap, &kafkalib.TopicConfig{TableName: "orders"}, config.Replication) diff --git a/models/event/events_suite_test.go b/models/event/events_suite_test.go index c2bda67aa..f141aede1 100644 --- a/models/event/events_suite_test.go +++ b/models/event/events_suite_test.go @@ -34,7 +34,7 @@ func (e *EventsTestSuite) SetupTest() { fakeEvent := &mocks.FakeEvent{} fakeEvent.GetDataReturns(map[string]any{constants.DeleteColumnMarker: false, constants.OnlySetDeleteColumnMarker: false}, nil) fakeEvent.GetColumnsReturns(&columns.Columns{}, nil) - + fakeEvent.GetTableNameReturns("foo") e.fakeEvent = fakeEvent }