Documentation
¶
Index ¶
- Constants
- func CreateEmptyTestDb(t *testing.T) *sql.DB
- func CreateTestDb(t *testing.T) *sql.DB
- func GetSendRequests(m *mocks.Delivery) []interfaces.SendRequest
- func MockDeliveryAcceptAll(t *testing.T) *mocks.Delivery
- func MockDeliveryWithSendCounter(t *testing.T) (*mocks.Delivery, *atomic.Int32)
- func MustParseTopic(t *testing.T, topicStr string) *topicpkg.Topic
- func MustParseTopicBytes(t *testing.T, topicStr string) []byte
- func RequireEventuallySendCount(t *testing.T, counter *atomic.Int32, want int32)
- func RequireSendRequestForInstallation(t *testing.T, reqs []interfaces.SendRequest, installationID string) interfaces.SendRequest
- func TestLogger(t *testing.T) *zap.Logger
Constants ¶
View Source
const TEST_DSN = "postgres://postgres:xmtp@localhost:25432/postgres?sslmode=disable"
Variables ¶
This section is empty.
Functions ¶
func GetSendRequests ¶
func GetSendRequests(m *mocks.Delivery) []interfaces.SendRequest
GetSendRequests extracts all SendRequest arguments from a mock Delivery's Send calls.
func MockDeliveryAcceptAll ¶
MockDeliveryAcceptAll creates a mock Delivery that accepts and succeeds on all sends.
func MockDeliveryWithSendCounter ¶
MockDeliveryWithSendCounter creates a mock Delivery that accepts all sends, increments the counter on each Send call, and returns nil.
func MustParseTopic ¶
MustParseTopic parses a V3 topic string or fails the test.
func MustParseTopicBytes ¶
MustParseTopicBytes parses a V3 topic string and returns raw bytes, or fails.
func RequireEventuallySendCount ¶
RequireEventuallySendCount asserts that the counter reaches want within 1 second.
func RequireSendRequestForInstallation ¶
func RequireSendRequestForInstallation(t *testing.T, reqs []interfaces.SendRequest, installationID string) interfaces.SendRequest
RequireSendRequestForInstallation finds the SendRequest for a given installation ID or fails.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.