testutil

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttemptFactory = &mockAttemptFactory{}
View Source
var DestinationFactory = &mockDestinationFactory{}
View Source
var EventFactory = &mockEventFactory{}
View Source
var TenantFactory = &mockTenantFactory{}
View Source
var TestTopics = []string{
	"user.created",
	"user.deleted",
	"user.updated",
}

must be sorted

Functions

func CheckIntegrationTest

func CheckIntegrationTest(t *testing.T)

func CreateTestLogger

func CreateTestLogger(t *testing.T) *logging.Logger

func CreateTestRedisClient

func CreateTestRedisClient(t *testing.T) internalredis.Client

func CreateTestRedisConfig

func CreateTestRedisConfig(t *testing.T) *internalredis.RedisConfig

func DeclareTestAWSInfrastructure

func DeclareTestAWSInfrastructure(ctx context.Context, cfg *mqs.AWSSQSConfig, attributes map[string]string) (string, error)

func DeclareTestRabbitMQInfrastructure

func DeclareTestRabbitMQInfrastructure(ctx context.Context, config *mqs.RabbitMQConfig) error

func ExtractRabbitPassword

func ExtractRabbitPassword(endpoint string) string

ExtractRabbitPassword extracts the password from the endpoint for example: amqp://u:p@localhost:5672 -> p

func ExtractRabbitURL

func ExtractRabbitURL(endpoint string) string

ExtractRabbitURL extracts the address from the endpoint for example: amqp://guest:guest@localhost:5672 -> localhost:5672

func ExtractRabbitUsername

func ExtractRabbitUsername(endpoint string) string

ExtractRabbitUsername extracts the username from the endpoint for example: amqp://u:p@localhost:5672 -> u

func Integration

func Integration(t *testing.T)

func MustMarshalJSON

func MustMarshalJSON(v any) []byte

func NewMockEventTracer

func NewMockEventTracer(exporter traceSDK.SpanExporter) *mockEventTracerImpl

func Race

func Race(t *testing.T)

func RandomPort

func RandomPort() string

RandomPort returns a random port string in the range :10000–:59999.

func RandomPortNumber

func RandomPortNumber() int

func RandomString

func RandomString(length int) string

func SkipUnlessCompat added in v0.12.0

func SkipUnlessCompat(t *testing.T)

func TeardownTestRabbitMQInfrastructure

func TeardownTestRabbitMQInfrastructure(ctx context.Context, cfg *mqs.RabbitMQConfig) error

Types

type MockMsg

type MockMsg struct {
	ID string
}

func (*MockMsg) FromMessage

func (m *MockMsg) FromMessage(msg *mqs.Message) error

func (*MockMsg) ToMessage

func (m *MockMsg) ToMessage() (*mqs.Message, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL