testutil

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DestinationFactory = &mockDestinationFactory{}
View Source
var EventFactory = &mockEventFactory{}
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) *otelzap.Logger

func CreateTestRedisClient

func CreateTestRedisClient(t *testing.T) *redis.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 NewMockEventTracer

func NewMockEventTracer(exporter traceSDK.SpanExporter) *mockEventTracerImpl

func RandomPort

func RandomPort() string

Create a random port number between 3500 and 3600

func RandomPortNumber

func RandomPortNumber() int

func RandomString

func RandomString(length int) string

func TeardownTestRabbitMQInfrastructure

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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