From f73c9598308ec8322a05481152c8f3d14cda0adc Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 1 Jan 2026 14:01:58 -0500 Subject: [PATCH] More test changes --- .../handler/message_event_response_test.go | 4 ++-- .../handler/scheduled_message_event_test.go | 22 +++++++++---------- internal/handler/scheduled_message_test.go | 12 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/handler/message_event_response_test.go b/internal/handler/message_event_response_test.go index 388763e..7b03a0c 100644 --- a/internal/handler/message_event_response_test.go +++ b/internal/handler/message_event_response_test.go @@ -60,7 +60,7 @@ func TestRecordMessageEventResponseWithMock(t *testing.T) { sent := now.Add(30 * time.Minute) var merResponse map[string]any - merResponse, err = TestConvertStringToMapOfAny(TestMERResponseInString()) + merResponse, err = ConvertStringToMapOfAny(MERResponseInString()) assert.NoError(t, err, "Error Converting to map[string]any") testReq := RecordEventRequest{ScheduledMessageEventId: event.Id, Response: merResponse, UserId: schMsg.UserId, Sent: &sent, Status: evnt.Message_Event_Response_Status_Scheduled} @@ -132,7 +132,7 @@ func TestGetMessageEventResponse(t *testing.T) { m.Status = evnt.Message_Event_Response_Status_Scheduled m.Sent = sent var merResponse map[string]any - merResponse, err = TestConvertStringToMapOfAny(TestMERResponseInString()) + merResponse, err = ConvertStringToMapOfAny(MERResponseInString()) assert.NoError(t, err, "Error Converting to map[string]any") m.Response = merResponse diff --git a/internal/handler/scheduled_message_event_test.go b/internal/handler/scheduled_message_event_test.go index ade1517..ce98975 100644 --- a/internal/handler/scheduled_message_event_test.go +++ b/internal/handler/scheduled_message_event_test.go @@ -47,9 +47,9 @@ func TestCreateScheduledMessageEventWithMock(t *testing.T) { scheduledMessageId := uuid.New() testUserId := uuid.New() - con := TestContact(contactId, testUserId) - msg := TestMessage(messageId, testUserId) - schMsg := TestScheduledMessage(scheduledMessageId, testUserId, now) + con := ContactTest(contactId, testUserId) + msg := MessageTest(messageId, testUserId) + schMsg := ScheduledMessageTest(scheduledMessageId, testUserId, now) ctx := t.Context() @@ -99,10 +99,10 @@ func TestGetScheduledMessageEventWithMock(t *testing.T) { scheduledMessageId := uuid.New() testUserId := uuid.New() - con := TestContact(contactId, testUserId) - msg := TestMessage(messageId, testUserId) - schMsg := TestScheduledMessage(scheduledMessageId, testUserId, now) - event := TestScheduledMessageEvent(msg.Id, *con.Id, schMsg.Id) + con := ContactTest(contactId, testUserId) + msg := MessageTest(messageId, testUserId) + schMsg := ScheduledMessageTest(scheduledMessageId, testUserId, now) + event := ScheduledMessageEventTest(*msg.Id, *con.Id, schMsg.Id) ctx := t.Context() @@ -145,10 +145,10 @@ func TestDeleteScheduledMessageEventWithMock(t *testing.T) { assert.NoError(t, err, "Error getting app") handler := NewScheduledMessageEventHandler(apiApp, schMsgEventStore, schMsgStore) - con := TestContact(contactId, testUserId) - msg := TestMessage(messageId, testUserId) - schMsg := TestScheduledMessage(scheduledMessageId, testUserId, now) - event := TestScheduledMessageEvent(msg.Id, *con.Id, schMsg.Id) + con := ContactTest(contactId, testUserId) + msg := MessageTest(messageId, testUserId) + schMsg := ScheduledMessageTest(scheduledMessageId, testUserId, now) + event := ScheduledMessageEventTest(*msg.Id, *con.Id, schMsg.Id) ctx := t.Context() diff --git a/internal/handler/scheduled_message_test.go b/internal/handler/scheduled_message_test.go index 60ce7dd..364f328 100644 --- a/internal/handler/scheduled_message_test.go +++ b/internal/handler/scheduled_message_test.go @@ -31,7 +31,7 @@ func TestCreateScheduledMessageWithMock(t *testing.T) { handler := NewScheduledMessageHandler(apiApp, mockStore) testUserId := uuid.New() - testBody := testCreateScheduledMessageRequest(testUserId, now) + testBody := createScheduledMessageRequest(testUserId, now) jsonValue, _ := json.Marshal(testBody) req, _ := http.NewRequest("POST", endpoint.ScheduleMessageEndpoint, strings.NewReader(string(jsonValue))) @@ -94,10 +94,10 @@ func TestFetchScheduledMessageWithMock(t *testing.T) { scheduledMessageId := uuid.New() testUserId := uuid.New() - con := TestContact(contactId, testUserId) - msg := TestMessage(messageId, testUserId) - schMsg := TestScheduledMessage(scheduledMessageId, testUserId, now) - event := TestScheduledMessageEvent(msg.Id, *con.Id, schMsg.Id) + con := ContactTest(contactId, testUserId) + msg := MessageTest(messageId, testUserId) + schMsg := ScheduledMessageTest(scheduledMessageId, testUserId, now) + event := ScheduledMessageEventTest(*msg.Id, *con.Id, schMsg.Id) ctx := t.Context() @@ -135,7 +135,7 @@ func TestFetchScheduledMessageWithMock(t *testing.T) { assert.Equal(t, scheduling.Processing, fetchedSchMsg.Status, "The statuses do not match") } -func testCreateScheduledMessageRequest(userId uuid.UUID, now time.Time) CreateScheduledMessageRequest { +func createScheduledMessageRequest(userId uuid.UUID, now time.Time) CreateScheduledMessageRequest { scheduled := now.Add(5 * time.Minute) return CreateScheduledMessageRequest{Status: scheduling.Pending, UserId: userId, Scheduled: scheduled} }