From 866ce73fe95a3fbacd6708cbf60130d4ef9e5b11 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Tue, 30 Jul 2024 13:34:25 -0700 Subject: [PATCH] Clean up. --- models/event/event_test.go | 6 ++++++ models/event/events_suite_test.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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 }