Documentation
¶
Index ¶
- Constants
- func OpenPreparedTestDB(ctx context.Context, dbURL string) (*pgxpool.Pool, error)
- func TestDB(t *testing.T) *pgxpool.Pool
- func TestDBURL() string
- func TruncateAll(t *testing.T, pool *pgxpool.Pool)
- type ContractServer
- type E2ATestServer
- type ReceivedPayload
- type SMTPAddr
- type SMTPMessage
- type WebhookReceiverResult
Constants ¶
View Source
const TestHMACSecret = "test-hmac-secret-for-testing"
Variables ¶
This section is empty.
Functions ¶
func OpenPreparedTestDB ¶
Types ¶
type ContractServer ¶
type ContractServer struct {
BaseURL string
APIKey string
UserID string
DBPool *pgxpool.Pool
Store *identity.Store
WSHub *ws.Hub
Signer *headers.Signer
SMTPAddr string
// contains filtered or unexported fields
}
func StartContractServer ¶
func StartContractServer(ctx context.Context, dbURL string) (*ContractServer, error)
type E2ATestServer ¶
type E2ATestServer struct {
HTTPServer *httptest.Server
SMTPAddr string
Store *identity.Store
Signer *headers.Signer
WSHub *ws.Hub
// contains filtered or unexported fields
}
func TestServer ¶
func TestServer(t *testing.T, pool *pgxpool.Pool) *E2ATestServer
type ReceivedPayload ¶
type SMTPAddr ¶
SMTPAddr holds parsed host and port for a fake SMTP server.
func FakeSMTPServer ¶
func FakeSMTPServer(t *testing.T) (SMTPAddr, func() []SMTPMessage)
FakeSMTPServer starts a minimal SMTP server that accepts messages. Returns the address and a function to call to stop the server and get received messages.
type SMTPMessage ¶
type SMTPMessage struct {
From string
To string // first RCPT TO (backward compat)
Recipients []string // all RCPT TO addresses
Data string
}
SMTPMessage represents a message received by the fake SMTP server.
type WebhookReceiverResult ¶
type WebhookReceiverResult struct {
Server *httptest.Server
// contains filtered or unexported fields
}
func WebhookReceiver ¶
func WebhookReceiver(t *testing.T) *WebhookReceiverResult
func (*WebhookReceiverResult) Payloads ¶
func (w *WebhookReceiverResult) Payloads() []ReceivedPayload
func (*WebhookReceiverResult) WaitForPayloads ¶
func (w *WebhookReceiverResult) WaitForPayloads(t *testing.T, count int, timeout time.Duration) []ReceivedPayload
Click to show internal directories.
Click to hide internal directories.