Documentation
¶
Index ¶
- Variables
- func CheckIntegrationTest(t *testing.T)
- func CheckJSONResponse(header http.Header, body []byte) error
- func CreateTestLogger(t *testing.T) *logging.Logger
- func CreateTestRedisClient(t *testing.T) internalredis.Client
- func CreateTestRedisConfig(t *testing.T) *internalredis.RedisConfig
- func DeclareTestAWSInfrastructure(ctx context.Context, cfg *mqs.AWSSQSConfig, attributes map[string]string) (string, error)
- func DeclareTestRabbitMQInfrastructure(ctx context.Context, config *mqs.RabbitMQConfig) error
- func ExtractRabbitPassword(endpoint string) string
- func ExtractRabbitURL(endpoint string) string
- func ExtractRabbitUsername(endpoint string) string
- func Integration(t *testing.T)
- func MustMarshalJSON(v any) []byte
- func NewMockEventTracer(exporter traceSDK.SpanExporter) *mockEventTracerImpl
- func Race(t *testing.T)
- func RandomPort() string
- func RandomPortNumber() int
- func RandomString(length int) string
- func RequireErrorResponse(t testing.TB, resp *httptest.ResponseRecorder, status int, message string)
- func RequireJSONResponse(t testing.TB, request string, status int, header http.Header, body []byte)
- func SkipUnlessCompat(t *testing.T)
- func TeardownTestRabbitMQInfrastructure(ctx context.Context, cfg *mqs.RabbitMQConfig) error
- type MockMsg
Constants ¶
This section is empty.
Variables ¶
var AttemptFactory = &mockAttemptFactory{}
var DestinationFactory = &mockDestinationFactory{}
var EventFactory = &mockEventFactory{}
var Registry destregistry.Registry
var TenantFactory = &mockTenantFactory{}
var TestTopics = []string{
"user.created",
"user.deleted",
"user.updated",
}
must be sorted
Functions ¶
func CheckIntegrationTest ¶
func CheckJSONResponse ¶ added in v1.6.0
CheckJSONResponse reports why a response is not JSON with a body.
func CreateTestRedisClient ¶
func CreateTestRedisClient(t *testing.T) internalredis.Client
func CreateTestRedisConfig ¶
func CreateTestRedisConfig(t *testing.T) *internalredis.RedisConfig
func DeclareTestRabbitMQInfrastructure ¶
func DeclareTestRabbitMQInfrastructure(ctx context.Context, config *mqs.RabbitMQConfig) error
func ExtractRabbitPassword ¶
ExtractRabbitPassword extracts the password from the endpoint for example: amqp://u:p@localhost:5672 -> p
func ExtractRabbitURL ¶
ExtractRabbitURL extracts the address from the endpoint for example: amqp://guest:guest@localhost:5672 -> localhost:5672
func ExtractRabbitUsername ¶
ExtractRabbitUsername extracts the username from the endpoint for example: amqp://u:p@localhost:5672 -> u
func Integration ¶
func MustMarshalJSON ¶
func NewMockEventTracer ¶
func NewMockEventTracer(exporter traceSDK.SpanExporter) *mockEventTracerImpl
func RandomPort ¶
func RandomPort() string
RandomPort returns a random port string in the range :10000–:59999.
func RandomPortNumber ¶
func RandomPortNumber() int
func RandomString ¶
func RequireErrorResponse ¶ added in v1.6.0
func RequireErrorResponse(t testing.TB, resp *httptest.ResponseRecorder, status int, message string)
RequireErrorResponse asserts that resp is the JSON error envelope with the given status code and message.
func RequireJSONResponse ¶ added in v1.6.0
RequireJSONResponse fails the test unless an API response has Content-Type application/json and a JSON object or array as its body. request describes the request in the failure message, e.g. "GET /api/v1/tenants".
func SkipUnlessCompat ¶ added in v0.12.0
func TeardownTestRabbitMQInfrastructure ¶
func TeardownTestRabbitMQInfrastructure(ctx context.Context, cfg *mqs.RabbitMQConfig) error