Skip to content

Commit

Permalink
Update client tests for message delivery indication
Browse files Browse the repository at this point in the history
This commit adds checks in the testing functions to verify the successful implementation of message delivery status. A new attribute `isDelivered` is now being validated in our tests, reinforcing the message tracking system and enhancing the overall reliability of our application.
  • Loading branch information
wneessen committed Jan 23, 2024
1 parent 0b62236 commit 6746af4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ func TestClient_DialSendClose(t *testing.T) {
if err := c.Close(); err != nil {
t.Errorf("Close() failed: %s", err)
}
if !m.IsDelivered() {
t.Errorf("message should be delivered but is indicated no to")
}
}

// TestClient_DialAndSendWithContext tests the DialAndSendWithContext() method of Client
Expand Down Expand Up @@ -1134,7 +1137,9 @@ func TestClient_DialAndSendWithContext_withSendError(t *testing.T) {
}
if se.IsTemp() {
t.Errorf("expected permanent error but IsTemp() returned true")
return
}
if m.IsDelivered() {
t.Errorf("message is indicated to be delivered but shouldn't")
}
}

Expand Down

0 comments on commit 6746af4

Please sign in to comment.