testing

package
v1.0.56 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTestData

func CleanupTestData(app *TestApp, endpoint, id string) error

CleanupTestData removes test data

func CreateTestData

func CreateTestData(app *TestApp, endpoint string, data map[string]any) (string, error)

CreateTestData creates test data for scenarios

func NewMockDatapoint

func NewMockDatapoint(value float64, unit types.StandardUnit) types.Datapoint

NewMockDatapoint creates a mock Datapoint for testing

func NewMockDeleteAlarmsOutput

func NewMockDeleteAlarmsOutput() *cloudwatch.DeleteAlarmsOutput

NewMockDeleteAlarmsOutput creates a mock DeleteAlarmsOutput

func NewMockDeleteAnomalyDetectorOutput

func NewMockDeleteAnomalyDetectorOutput() *cloudwatch.DeleteAnomalyDetectorOutput

NewMockDeleteAnomalyDetectorOutput creates a mock DeleteAnomalyDetectorOutput

func NewMockDescribeAlarmsOutput

func NewMockDescribeAlarmsOutput(alarms []types.MetricAlarm) *cloudwatch.DescribeAlarmsOutput

NewMockDescribeAlarmsOutput creates a mock DescribeAlarmsOutput with alarms

func NewMockDescribeAnomalyDetectorsOutput

func NewMockDescribeAnomalyDetectorsOutput(detectors []types.AnomalyDetector) *cloudwatch.DescribeAnomalyDetectorsOutput

NewMockDescribeAnomalyDetectorsOutput creates a mock DescribeAnomalyDetectorsOutput

func NewMockDimension

func NewMockDimension(name, value string) types.Dimension

NewMockDimension creates a mock Dimension for testing

func NewMockGetMetricDataOutput

func NewMockGetMetricDataOutput(results []types.MetricDataResult) *cloudwatch.GetMetricDataOutput

NewMockGetMetricDataOutput creates a mock GetMetricDataOutput with results

func NewMockGetMetricStatisticsOutput

func NewMockGetMetricStatisticsOutput(datapoints []types.Datapoint) *cloudwatch.GetMetricStatisticsOutput

NewMockGetMetricStatisticsOutput creates a mock GetMetricStatisticsOutput with datapoints

func NewMockListMetricsOutput

func NewMockListMetricsOutput(metrics []types.Metric) *cloudwatch.ListMetricsOutput

NewMockListMetricsOutput creates a mock ListMetricsOutput with metrics

func NewMockListTagsForResourceOutput

func NewMockListTagsForResourceOutput(tags []types.Tag) *cloudwatch.ListTagsForResourceOutput

NewMockListTagsForResourceOutput creates a mock ListTagsForResourceOutput

func NewMockMetric

func NewMockMetric(name, namespace string) types.Metric

NewMockMetric creates a mock Metric for testing

func NewMockMetricAlarm

func NewMockMetricAlarm(name, metricName string, threshold float64) types.MetricAlarm

NewMockMetricAlarm creates a mock MetricAlarm for testing

func NewMockMetricDatum

func NewMockMetricDatum(name string, value float64, unit types.StandardUnit) types.MetricDatum

NewMockMetricDatum creates a mock MetricDatum for testing

func NewMockPutAnomalyDetectorOutput

func NewMockPutAnomalyDetectorOutput() *cloudwatch.PutAnomalyDetectorOutput

NewMockPutAnomalyDetectorOutput creates a mock PutAnomalyDetectorOutput

func NewMockPutMetricAlarmOutput

func NewMockPutMetricAlarmOutput() *cloudwatch.PutMetricAlarmOutput

NewMockPutMetricAlarmOutput creates a mock PutMetricAlarmOutput

func NewMockPutMetricDataOutput

func NewMockPutMetricDataOutput() *cloudwatch.PutMetricDataOutput

NewMockPutMetricDataOutput creates a mock PutMetricDataOutput

func NewMockTag

func NewMockTag(key, value string) types.Tag

NewMockTag creates a mock Tag for testing

func NewMockTagResourceOutput

func NewMockTagResourceOutput() *cloudwatch.TagResourceOutput

NewMockTagResourceOutput creates a mock TagResourceOutput

func NewMockUntagResourceOutput

func NewMockUntagResourceOutput() *cloudwatch.UntagResourceOutput

NewMockUntagResourceOutput creates a mock UntagResourceOutput

func RunScenarios

func RunScenarios(t *testing.T, app *TestApp, scenarios []TestScenario)

RunScenarios executes a collection of test scenarios

func TestRateLimiting

func TestRateLimiting(t *testing.T, app *TestApp, endpoint string, limit int)

TestRateLimiting is a helper function for testing rate limiting

Types

type AlarmState

type AlarmState string

AlarmState represents the state of a CloudWatch alarm

const (
	AlarmStateOK               AlarmState = "OK"
	AlarmStateAlarm            AlarmState = "ALARM"
	AlarmStateInsufficientData AlarmState = "INSUFFICIENT_DATA"
)

type AuthConfig

type AuthConfig struct {
	Token    string
	TenantID string
	UserID   string
	Scopes   []string
}

AuthConfig holds authentication configuration for tests

type ComparisonOperator

type ComparisonOperator string

ComparisonOperator represents alarm comparison operators

const (
	ComparisonGreaterThanThreshold                     ComparisonOperator = "GreaterThanThreshold"
	ComparisonGreaterThanOrEqualToThreshold            ComparisonOperator = "GreaterThanOrEqualToThreshold"
	ComparisonLessThanThreshold                        ComparisonOperator = "LessThanThreshold"
	ComparisonLessThanOrEqualToThreshold               ComparisonOperator = "LessThanOrEqualToThreshold"
	ComparisonLessThanLowerOrGreaterThanUpperThreshold ComparisonOperator = "LessThanLowerOrGreaterThanUpperThreshold"
	ComparisonLessThanLowerThreshold                   ComparisonOperator = "LessThanLowerThreshold"
	ComparisonGreaterThanUpperThreshold                ComparisonOperator = "GreaterThanUpperThreshold"
)

type ConnectionState

type ConnectionState string

ConnectionState represents the state of a WebSocket connection

const (
	ConnectionStateActive       ConnectionState = "ACTIVE"
	ConnectionStateDisconnected ConnectionState = "DISCONNECTED"
	ConnectionStateStale        ConnectionState = "STALE"
)

type LoadTestConfig

type LoadTestConfig struct {
	ConcurrentUsers   int           `json:"concurrent_users"`
	TotalRequests     int           `json:"total_requests"`
	Duration          time.Duration `json:"duration"`
	RampUpDuration    time.Duration `json:"ramp_up_duration"`
	MaxLatency        time.Duration `json:"max_latency"`
	ErrorThreshold    float64       `json:"error_threshold"`
	RequestsPerSecond int           `json:"requests_per_second"`
}

LoadTestConfig configures load testing parameters

type LoadTestResult

type LoadTestResult struct {
	TotalRequests      int           `json:"total_requests"`
	SuccessfulRequests int           `json:"successful_requests"`
	FailedRequests     int           `json:"failed_requests"`
	AverageLatency     time.Duration `json:"average_latency"`
	P95Latency         time.Duration `json:"p95_latency"`
	P99Latency         time.Duration `json:"p99_latency"`
	MaxLatency         time.Duration `json:"max_latency"`
	MinLatency         time.Duration `json:"min_latency"`
	RequestsPerSecond  float64       `json:"requests_per_second"`
	ErrorRate          float64       `json:"error_rate"`
	Duration           time.Duration `json:"duration"`
	Errors             []string      `json:"errors"`
	StartTime          time.Time     `json:"start_time"`
	EndTime            time.Time     `json:"end_time"`
}

LoadTestResult represents the result of a load test

type LoadTester

type LoadTester struct {
	// contains filtered or unexported fields
}

LoadTester provides load testing capabilities

func NewLoadTester

func NewLoadTester(app *TestApp, config *LoadTestConfig) *LoadTester

NewLoadTester creates a new load tester

func (*LoadTester) RunLoadTest

func (lt *LoadTester) RunLoadTest(ctx context.Context, request func(*TestApp) *TestResponse) (*LoadTestResult, error)

RunLoadTest executes a load test scenario

type MetricUnit

type MetricUnit string

MetricUnit represents CloudWatch metric units

const (
	MetricUnitNone           MetricUnit = "None"
	MetricUnitSeconds        MetricUnit = "Seconds"
	MetricUnitMicroseconds   MetricUnit = "Microseconds"
	MetricUnitMilliseconds   MetricUnit = "Milliseconds"
	MetricUnitBytes          MetricUnit = "Bytes"
	MetricUnitKilobytes      MetricUnit = "Kilobytes"
	MetricUnitMegabytes      MetricUnit = "Megabytes"
	MetricUnitGigabytes      MetricUnit = "Gigabytes"
	MetricUnitTerabytes      MetricUnit = "Terabytes"
	MetricUnitBits           MetricUnit = "Bits"
	MetricUnitKilobits       MetricUnit = "Kilobits"
	MetricUnitMegabits       MetricUnit = "Megabits"
	MetricUnitGigabits       MetricUnit = "Gigabits"
	MetricUnitTerabits       MetricUnit = "Terabits"
	MetricUnitPercent        MetricUnit = "Percent"
	MetricUnitCount          MetricUnit = "Count"
	MetricUnitCountPerSecond MetricUnit = "Count/Second"
)

type MockAPIGatewayConfig

type MockAPIGatewayConfig struct {
	// Connection TTL in seconds (default: 7200 = 2 hours)
	ConnectionTTL int64
	// Maximum message size in bytes (default: 128KB)
	MaxMessageSize int64
	// Simulate network delays
	NetworkDelay time.Duration
	// Error simulation rates (0.0 to 1.0)
	ErrorRates map[string]float64
}

MockAPIGatewayConfig configures the behavior of the API Gateway mock

func DefaultMockAPIGatewayConfig

func DefaultMockAPIGatewayConfig() *MockAPIGatewayConfig

DefaultMockAPIGatewayConfig returns default configuration

type MockAPIGatewayError

type MockAPIGatewayError struct {
	Code       string
	Message    string
	StatusCode int
	Retryable  bool
}

MockAPIGatewayError implements the APIError interface for testing

func (*MockAPIGatewayError) Error

func (e *MockAPIGatewayError) Error() string

func (*MockAPIGatewayError) ErrorCode

func (e *MockAPIGatewayError) ErrorCode() string

func (*MockAPIGatewayError) HTTPStatusCode

func (e *MockAPIGatewayError) HTTPStatusCode() int

func (*MockAPIGatewayError) IsRetryable

func (e *MockAPIGatewayError) IsRetryable() bool

type MockAPIGatewayManagementClient

type MockAPIGatewayManagementClient struct {
	// contains filtered or unexported fields
}

MockAPIGatewayManagementClient provides a mock implementation of API Gateway Management API

func NewMockAPIGatewayManagementClient

func NewMockAPIGatewayManagementClient() *MockAPIGatewayManagementClient

NewMockAPIGatewayManagementClient creates a new mock API Gateway Management client

func (*MockAPIGatewayManagementClient) DeleteConnection

func (m *MockAPIGatewayManagementClient) DeleteConnection(ctx context.Context, connectionID string) error

DeleteConnection terminates a WebSocket connection

func (*MockAPIGatewayManagementClient) GetActiveConnections

func (m *MockAPIGatewayManagementClient) GetActiveConnections() map[string]*MockConnection

GetActiveConnections returns all active connections

func (*MockAPIGatewayManagementClient) GetCallCount

func (m *MockAPIGatewayManagementClient) GetCallCount(operation string) int

GetCallCount returns the number of times an operation was called

func (*MockAPIGatewayManagementClient) GetConnection

func (m *MockAPIGatewayManagementClient) GetConnection(ctx context.Context, connectionID string) (*MockConnectionInfo, error)

GetConnection retrieves connection information

func (*MockAPIGatewayManagementClient) GetConnectionState

func (m *MockAPIGatewayManagementClient) GetConnectionState(connectionID string) *MockConnection

GetConnectionState returns a copy of the connection state

func (*MockAPIGatewayManagementClient) GetMessageCount

func (m *MockAPIGatewayManagementClient) GetMessageCount(connectionID string) int

GetMessageCount returns the number of messages sent to a connection

func (*MockAPIGatewayManagementClient) GetMessages

func (m *MockAPIGatewayManagementClient) GetMessages(connectionID string) [][]byte

GetMessages returns all messages sent to a connection

func (*MockAPIGatewayManagementClient) PostToConnection

func (m *MockAPIGatewayManagementClient) PostToConnection(ctx context.Context, connectionID string, data []byte) error

PostToConnection sends data to a WebSocket connection

func (*MockAPIGatewayManagementClient) Reset

func (m *MockAPIGatewayManagementClient) Reset()

Reset clears all mock state

func (*MockAPIGatewayManagementClient) SimulateConnectionExpiry

func (m *MockAPIGatewayManagementClient) SimulateConnectionExpiry()

SimulateConnectionExpiry marks connections as stale based on TTL

func (*MockAPIGatewayManagementClient) WithConfig

WithConfig sets the mock configuration

func (*MockAPIGatewayManagementClient) WithConnection

WithConnection adds a connection to the mock

func (*MockAPIGatewayManagementClient) WithError

WithError configures an error for a specific connection

type MockAWSService

type MockAWSService struct {
	// contains filtered or unexported fields
}

MockAWSService provides a generic mock for AWS services

func NewMockAWSService

func NewMockAWSService() *MockAWSService

NewMockAWSService creates a new mock AWS service

func (*MockAWSService) Call

func (m *MockAWSService) Call(operation string, input any) (any, error)

Call simulates calling an AWS service operation

func (*MockAWSService) GetCallCount

func (m *MockAWSService) GetCallCount(operation string) int

GetCallCount returns the number of times an operation was called

func (*MockAWSService) Reset

func (m *MockAWSService) Reset()

Reset clears all mock state

func (*MockAWSService) WithError

func (m *MockAWSService) WithError(operation string, err error) *MockAWSService

WithError configures an error for an operation

func (*MockAWSService) WithResponse

func (m *MockAWSService) WithResponse(operation string, response any) *MockAWSService

WithResponse configures a response for an operation

type MockAlarmDefinition

type MockAlarmDefinition struct {
	AlarmName          string             `json:"alarm_name"`
	AlarmDescription   string             `json:"alarm_description"`
	MetricName         string             `json:"metric_name"`
	Namespace          string             `json:"namespace"`
	Statistic          Statistic          `json:"statistic"`
	Dimensions         map[string]string  `json:"dimensions,omitempty"`
	Period             int32              `json:"period"`
	EvaluationPeriods  int32              `json:"evaluation_periods"`
	Threshold          float64            `json:"threshold"`
	ComparisonOperator ComparisonOperator `json:"comparison_operator"`
	TreatMissingData   string             `json:"treat_missing_data"`
	State              AlarmState         `json:"state"`
	StateReason        string             `json:"state_reason"`
	StateUpdatedAt     time.Time          `json:"state_updated_at"`
	CreatedAt          time.Time          `json:"created_at"`
	UpdatedAt          time.Time          `json:"updated_at"`
}

MockAlarmDefinition represents a CloudWatch alarm

type MockCloudWatchAlarmsClient

type MockCloudWatchAlarmsClient struct {
	// contains filtered or unexported fields
}

MockCloudWatchAlarmsClient provides a mock implementation of CloudWatch Alarms

func NewMockCloudWatchAlarmsClient

func NewMockCloudWatchAlarmsClient() *MockCloudWatchAlarmsClient

NewMockCloudWatchAlarmsClient creates a new mock CloudWatch Alarms client

func (*MockCloudWatchAlarmsClient) DeleteAlarms

func (m *MockCloudWatchAlarmsClient) DeleteAlarms(ctx context.Context, alarmNames []string) error

DeleteAlarms deletes one or more alarms

func (*MockCloudWatchAlarmsClient) DescribeAlarms

func (m *MockCloudWatchAlarmsClient) DescribeAlarms(ctx context.Context, alarmNames []string) ([]*MockAlarmDefinition, error)

DescribeAlarms retrieves alarm information

func (*MockCloudWatchAlarmsClient) EvaluateAlarms

func (m *MockCloudWatchAlarmsClient) EvaluateAlarms(ctx context.Context) error

EvaluateAlarms evaluates all alarms against current metrics

func (*MockCloudWatchAlarmsClient) GetAlarm

func (m *MockCloudWatchAlarmsClient) GetAlarm(alarmName string) *MockAlarmDefinition

GetAlarm returns a copy of an alarm definition

func (*MockCloudWatchAlarmsClient) GetAllAlarms

func (m *MockCloudWatchAlarmsClient) GetAllAlarms() map[string]*MockAlarmDefinition

GetAllAlarms returns all alarm definitions

func (*MockCloudWatchAlarmsClient) GetCallCount

func (m *MockCloudWatchAlarmsClient) GetCallCount(operation string) int

GetCallCount returns the number of times an operation was called

func (*MockCloudWatchAlarmsClient) PutMetricAlarm

func (m *MockCloudWatchAlarmsClient) PutMetricAlarm(ctx context.Context, alarm *MockAlarmDefinition) error

PutMetricAlarm creates or updates an alarm

func (*MockCloudWatchAlarmsClient) Reset

func (m *MockCloudWatchAlarmsClient) Reset()

Reset clears all mock state

func (*MockCloudWatchAlarmsClient) WithConfig

WithConfig sets the mock configuration

func (*MockCloudWatchAlarmsClient) WithError

func (m *MockCloudWatchAlarmsClient) WithError(operation string, err error) *MockCloudWatchAlarmsClient

WithError configures an error for a specific operation

func (*MockCloudWatchAlarmsClient) WithMetricsClient

WithMetricsClient sets the metrics client for alarm evaluation

type MockCloudWatchClient

type MockCloudWatchClient struct {
	mock.Mock
}

MockCloudWatchClient provides a testify-based mock of the AWS CloudWatch client that implements the exact AWS SDK interface, following the DynamORM pattern.

func NewMockCloudWatchClient

func NewMockCloudWatchClient() *MockCloudWatchClient

NewMockCloudWatchClient creates a new mock CloudWatch client

func (*MockCloudWatchClient) DeleteAlarms

DeleteAlarms deletes one or more alarms

func (*MockCloudWatchClient) DeleteAnomalyDetector

DeleteAnomalyDetector deletes an anomaly detector

func (*MockCloudWatchClient) DescribeAlarms

DescribeAlarms retrieves alarm information

func (*MockCloudWatchClient) DescribeAnomalyDetectors

DescribeAnomalyDetectors retrieves anomaly detector information

func (*MockCloudWatchClient) GetMetricData

GetMetricData retrieves metric data using metric queries

func (*MockCloudWatchClient) GetMetricStatistics

GetMetricStatistics retrieves statistics for a metric

func (*MockCloudWatchClient) ListMetrics

ListMetrics lists available metrics

func (*MockCloudWatchClient) ListTagsForResource

ListTagsForResource lists tags for a CloudWatch resource

func (*MockCloudWatchClient) PutAnomalyDetector

PutAnomalyDetector creates or updates an anomaly detector

func (*MockCloudWatchClient) PutMetricAlarm

PutMetricAlarm creates or updates an alarm

func (*MockCloudWatchClient) PutMetricData

PutMetricData publishes metric data to CloudWatch

func (*MockCloudWatchClient) TagResource

TagResource adds tags to a CloudWatch resource

func (*MockCloudWatchClient) UntagResource

UntagResource removes tags from a CloudWatch resource

type MockCloudWatchConfig

type MockCloudWatchConfig struct {
	// Maximum number of metrics per PutMetricData call
	MaxMetricsPerCall int
	// Simulate network delays
	NetworkDelay time.Duration
	// Auto-evaluate alarms when metrics are published
	AutoEvaluateAlarms bool
	// Metric retention period in hours
	MetricRetentionHours int
}

MockCloudWatchConfig configures the behavior of CloudWatch mocks

func DefaultMockCloudWatchConfig

func DefaultMockCloudWatchConfig() *MockCloudWatchConfig

DefaultMockCloudWatchConfig returns default configuration

type MockCloudWatchMetricsClient

type MockCloudWatchMetricsClient struct {
	// contains filtered or unexported fields
}

MockCloudWatchMetricsClient provides a mock implementation of CloudWatch Metrics

func NewMockCloudWatchMetricsClient

func NewMockCloudWatchMetricsClient() *MockCloudWatchMetricsClient

NewMockCloudWatchMetricsClient creates a new mock CloudWatch Metrics client

func (*MockCloudWatchMetricsClient) GetAllMetrics

func (m *MockCloudWatchMetricsClient) GetAllMetrics() map[string][]*MockMetricDatum

GetAllMetrics returns all metrics across all namespaces

func (*MockCloudWatchMetricsClient) GetCallCount

func (m *MockCloudWatchMetricsClient) GetCallCount(operation string) int

GetCallCount returns the number of times an operation was called

func (*MockCloudWatchMetricsClient) GetMetricStatistics

func (m *MockCloudWatchMetricsClient) GetMetricStatistics(ctx context.Context, namespace, metricName string, dimensions map[string]string, startTime, endTime time.Time, period int32, statistics []Statistic) (map[Statistic]float64, error)

GetMetricStatistics retrieves statistics for a metric

func (*MockCloudWatchMetricsClient) GetMetrics

func (m *MockCloudWatchMetricsClient) GetMetrics(namespace string) []*MockMetricDatum

GetMetrics returns all metrics for a namespace

func (*MockCloudWatchMetricsClient) PutMetricData

func (m *MockCloudWatchMetricsClient) PutMetricData(ctx context.Context, namespace string, metricData []*MockMetricDatum) error

PutMetricData publishes metric data to CloudWatch

func (*MockCloudWatchMetricsClient) Reset

func (m *MockCloudWatchMetricsClient) Reset()

Reset clears all mock state

func (*MockCloudWatchMetricsClient) WithConfig

WithConfig sets the mock configuration

func (*MockCloudWatchMetricsClient) WithError

WithError configures an error for a specific operation

type MockConnection

type MockConnection struct {
	ID           string          `json:"id"`
	State        ConnectionState `json:"state"`
	CreatedAt    time.Time       `json:"created_at"`
	LastActiveAt time.Time       `json:"last_active_at"`
	SourceIP     string          `json:"source_ip"`
	UserAgent    string          `json:"user_agent"`
	Metadata     map[string]any  `json:"metadata,omitempty"`
}

MockConnection represents a WebSocket connection in the mock

type MockConnectionInfo

type MockConnectionInfo struct {
	ConnectionID string `json:"connectionId"`
	ConnectedAt  string `json:"connectedAt"`
	LastActiveAt string `json:"lastActiveAt"`
	SourceIP     string `json:"sourceIp"`
	UserAgent    string `json:"userAgent"`
}

MockConnectionInfo represents connection information returned by GetConnection

type MockDynamORM

type MockDynamORM struct {

	// Behavior configuration
	FailOnOperation map[string]error         // operation -> error to return
	Delays          map[string]time.Duration // operation -> delay to add
	// contains filtered or unexported fields
}

MockDynamORM provides a mock implementation of DynamORM for testing

func NewMockDynamORM

func NewMockDynamORM() *MockDynamORM

NewMockDynamORM creates a new mock DynamORM instance

func (*MockDynamORM) BeginTransaction

func (m *MockDynamORM) BeginTransaction() (*MockTransaction, error)

BeginTransaction starts a mock transaction

func (*MockDynamORM) Delete

func (m *MockDynamORM) Delete(ctx context.Context, table, key string) error

Delete removes an item

func (*MockDynamORM) Get

func (m *MockDynamORM) Get(ctx context.Context, table, key string, result any) error

Get retrieves an item by key

func (*MockDynamORM) GetAllData

func (m *MockDynamORM) GetAllData() map[string]map[string]any

GetAllData returns all data for testing inspection

func (*MockDynamORM) Put

func (m *MockDynamORM) Put(ctx context.Context, table, key string, item any) error

Put saves an item

func (*MockDynamORM) Query

func (m *MockDynamORM) Query(ctx context.Context, table string, query *dynamorm.Query) (*dynamorm.QueryResult, error)

Query performs a query operation

func (*MockDynamORM) Reset

func (m *MockDynamORM) Reset()

Reset clears all data and resets the mock state

func (*MockDynamORM) WithData

func (m *MockDynamORM) WithData(table, key string, item any) *MockDynamORM

WithData pre-populates the mock with test data

func (*MockDynamORM) WithDelay

func (m *MockDynamORM) WithDelay(operation string, delay time.Duration) *MockDynamORM

WithDelay configures the mock to add delays to operations

func (*MockDynamORM) WithFailure

func (m *MockDynamORM) WithFailure(operation string, err error) *MockDynamORM

WithFailure configures the mock to fail on specific operations

type MockDynamORMWrapper

type MockDynamORMWrapper struct {
	// contains filtered or unexported fields
}

MockDynamORMWrapper wraps MockDynamORM to match the DynamORMWrapper interface

func NewMockDynamORMWrapper

func NewMockDynamORMWrapper(tableName string) *MockDynamORMWrapper

NewMockDynamORMWrapper creates a wrapper that matches DynamORMWrapper interface

func (*MockDynamORMWrapper) BeginTransaction

func (w *MockDynamORMWrapper) BeginTransaction() (any, error)

BeginTransaction starts a mock transaction

func (*MockDynamORMWrapper) Delete

func (w *MockDynamORMWrapper) Delete(ctx context.Context, key any) error

Delete removes an item (matches DynamORMWrapper interface)

func (*MockDynamORMWrapper) Get

func (w *MockDynamORMWrapper) Get(ctx context.Context, key any, result any) error

Get retrieves an item by key (matches DynamORMWrapper interface)

func (*MockDynamORMWrapper) GetAllData

func (w *MockDynamORMWrapper) GetAllData() map[string]map[string]any

GetAllData returns all data for testing inspection

func (*MockDynamORMWrapper) Put

func (w *MockDynamORMWrapper) Put(ctx context.Context, item any) error

Put saves an item (matches DynamORMWrapper interface)

func (*MockDynamORMWrapper) Query

func (w *MockDynamORMWrapper) Query(ctx context.Context, query any) (any, error)

Query performs a query operation (matches DynamORMWrapper interface)

func (*MockDynamORMWrapper) WithData

func (w *MockDynamORMWrapper) WithData(key string, item any) *MockDynamORMWrapper

WithData pre-populates the mock with test data

func (*MockDynamORMWrapper) WithFailure

func (w *MockDynamORMWrapper) WithFailure(operation string, err error) *MockDynamORMWrapper

WithFailure configures the mock to fail on specific operations

func (*MockDynamORMWrapper) WithTenant

func (w *MockDynamORMWrapper) WithTenant(tenantID string) *MockDynamORMWrapper

WithTenant creates a tenant-scoped wrapper

type MockHTTPClient

type MockHTTPClient struct {
	// contains filtered or unexported fields
}

MockHTTPClient provides a mock HTTP client for external API testing

func NewMockHTTPClient

func NewMockHTTPClient() *MockHTTPClient

NewMockHTTPClient creates a new mock HTTP client

func (*MockHTTPClient) Get

func (m *MockHTTPClient) Get(url string) (*MockHTTPResponse, error)

Get simulates an HTTP GET request

func (*MockHTTPClient) Reset

func (m *MockHTTPClient) Reset()

Reset clears all mock state

func (*MockHTTPClient) WithResponse

func (m *MockHTTPClient) WithResponse(url string, response *MockHTTPResponse) *MockHTTPClient

WithResponse configures a response for a URL

type MockHTTPResponse

type MockHTTPResponse struct {
	StatusCode int
	Body       string
	Headers    map[string]string
	Delay      time.Duration
}

MockHTTPResponse represents a mock HTTP response

type MockMetricDatum

type MockMetricDatum struct {
	MetricName string            `json:"metric_name"`
	Value      float64           `json:"value"`
	Unit       MetricUnit        `json:"unit"`
	Timestamp  time.Time         `json:"timestamp"`
	Dimensions map[string]string `json:"dimensions,omitempty"`
	Metadata   map[string]any    `json:"metadata,omitempty"`
}

MockMetricDatum represents a single metric data point

type MockTransaction

type MockTransaction struct {
	// contains filtered or unexported fields
}

MockTransaction represents a mock DynamORM transaction

func (*MockTransaction) Commit

func (tx *MockTransaction) Commit() error

Commit commits the transaction

func (*MockTransaction) Delete

func (tx *MockTransaction) Delete(ctx context.Context, table, key string) error

Delete adds a delete operation to the transaction

func (*MockTransaction) Put

func (tx *MockTransaction) Put(ctx context.Context, table, key string, item any) error

Put adds a put operation to the transaction

func (*MockTransaction) Rollback

func (tx *MockTransaction) Rollback() error

Rollback rolls back the transaction

type ScenarioRunner

type ScenarioRunner struct {
	// contains filtered or unexported fields
}

ScenarioRunner provides advanced scenario execution capabilities

func NewScenarioRunner

func NewScenarioRunner(app *TestApp) *ScenarioRunner

NewScenarioRunner creates a new scenario runner with advanced capabilities

func (*ScenarioRunner) RunScenariosAdvanced

func (sr *ScenarioRunner) RunScenariosAdvanced(t *testing.T, scenarios []TestScenario)

RunScenariosAdvanced executes scenarios with advanced features

func (*ScenarioRunner) WithParallelExecution

func (sr *ScenarioRunner) WithParallelExecution(enabled bool, maxConcurrency int) *ScenarioRunner

WithParallelExecution configures parallel execution

func (*ScenarioRunner) WithRetry

func (sr *ScenarioRunner) WithRetry(attempts int, delay time.Duration) *ScenarioRunner

WithRetry configures retry behavior

func (*ScenarioRunner) WithTimeouts

func (sr *ScenarioRunner) WithTimeouts(setup, cleanup time.Duration) *ScenarioRunner

WithTimeouts configures timeouts

type Statistic

type Statistic string

Statistic represents CloudWatch statistics

const (
	StatisticSampleCount Statistic = "SampleCount"
	StatisticAverage     Statistic = "Average"
	StatisticSum         Statistic = "Sum"
	StatisticMinimum     Statistic = "Minimum"
	StatisticMaximum     Statistic = "Maximum"
)

type StreamerAPIError

type StreamerAPIError interface {
	error
	HTTPStatusCode() int
	ErrorCode() string
	IsRetryable() bool
}

StreamerAPIError matches streamer's APIError interface

type StreamerAPIGatewayClient

type StreamerAPIGatewayClient interface {
	PostToConnection(ctx context.Context, connectionID string, data []byte) error
	DeleteConnection(ctx context.Context, connectionID string) error
	GetConnection(ctx context.Context, connectionID string) (*StreamerConnectionInfo, error)
}

StreamerAPIGatewayClient defines the interface that matches streamer's APIGatewayClient

type StreamerAPIGatewayClientMock

type StreamerAPIGatewayClientMock struct {
	// contains filtered or unexported fields
}

StreamerAPIGatewayClientMock implements the StreamerAPIGatewayClient interface

func NewStreamerAPIGatewayClientMock

func NewStreamerAPIGatewayClientMock() *StreamerAPIGatewayClientMock

NewStreamerAPIGatewayClientMock creates a new streamer-compatible API Gateway client mock

func (*StreamerAPIGatewayClientMock) DeleteConnection

func (m *StreamerAPIGatewayClientMock) DeleteConnection(ctx context.Context, connectionID string) error

DeleteConnection terminates a WebSocket connection Implements StreamerAPIGatewayClient interface

func (*StreamerAPIGatewayClientMock) GetActiveConnections

func (m *StreamerAPIGatewayClientMock) GetActiveConnections() map[string]*StreamerMockConnection

GetActiveConnections returns all active connections

func (*StreamerAPIGatewayClientMock) GetCallCount

func (m *StreamerAPIGatewayClientMock) GetCallCount(operation string) int

GetCallCount returns the number of times an operation was called

func (*StreamerAPIGatewayClientMock) GetConnection

func (m *StreamerAPIGatewayClientMock) GetConnection(ctx context.Context, connectionID string) (*StreamerConnectionInfo, error)

GetConnection retrieves connection information Implements StreamerAPIGatewayClient interface

func (*StreamerAPIGatewayClientMock) GetConnectionState

func (m *StreamerAPIGatewayClientMock) GetConnectionState(connectionID string) *StreamerMockConnection

GetConnectionState returns a copy of the connection state

func (*StreamerAPIGatewayClientMock) GetMessageCount

func (m *StreamerAPIGatewayClientMock) GetMessageCount(connectionID string) int

GetMessageCount returns the number of messages sent to a connection

func (*StreamerAPIGatewayClientMock) GetMessages

func (m *StreamerAPIGatewayClientMock) GetMessages(connectionID string) [][]byte

GetMessages returns all messages sent to a connection

func (*StreamerAPIGatewayClientMock) PostToConnection

func (m *StreamerAPIGatewayClientMock) PostToConnection(ctx context.Context, connectionID string, data []byte) error

PostToConnection sends data to a WebSocket connection Implements StreamerAPIGatewayClient interface

func (*StreamerAPIGatewayClientMock) Reset

func (m *StreamerAPIGatewayClientMock) Reset()

Reset clears all mock state

func (*StreamerAPIGatewayClientMock) SimulateConnectionExpiry

func (m *StreamerAPIGatewayClientMock) SimulateConnectionExpiry()

SimulateConnectionExpiry marks connections as stale based on TTL

func (*StreamerAPIGatewayClientMock) WithConfig

WithConfig sets the mock configuration

func (*StreamerAPIGatewayClientMock) WithConnection

WithConnection adds a connection to the mock

func (*StreamerAPIGatewayClientMock) WithError

func (m *StreamerAPIGatewayClientMock) WithError(connectionID string, err error) *StreamerAPIGatewayClientMock

WithError configures an error for a specific connection

func (*StreamerAPIGatewayClientMock) WithForbiddenError

func (m *StreamerAPIGatewayClientMock) WithForbiddenError(connectionID, message string) *StreamerAPIGatewayClientMock

WithForbiddenError configures a ForbiddenError for a specific connection

func (*StreamerAPIGatewayClientMock) WithGoneError

func (m *StreamerAPIGatewayClientMock) WithGoneError(connectionID, message string) *StreamerAPIGatewayClientMock

WithGoneError configures a GoneError for a specific connection

func (*StreamerAPIGatewayClientMock) WithInternalServerError

func (m *StreamerAPIGatewayClientMock) WithInternalServerError(connectionID, message string) *StreamerAPIGatewayClientMock

WithInternalServerError configures an InternalServerError for a specific connection

func (*StreamerAPIGatewayClientMock) WithPayloadTooLargeError

func (m *StreamerAPIGatewayClientMock) WithPayloadTooLargeError(connectionID string, payloadSize, maxSize int, message string) *StreamerAPIGatewayClientMock

WithPayloadTooLargeError configures a PayloadTooLargeError for a specific connection

func (*StreamerAPIGatewayClientMock) WithThrottlingError

func (m *StreamerAPIGatewayClientMock) WithThrottlingError(connectionID string, retryAfter int, message string) *StreamerAPIGatewayClientMock

WithThrottlingError configures a ThrottlingError for a specific connection

type StreamerConnectionInfo

type StreamerConnectionInfo struct {
	ConnectionID string
	ConnectedAt  string
	LastActiveAt string
	SourceIP     string
	UserAgent    string
}

StreamerConnectionInfo matches streamer's ConnectionInfo struct

type StreamerConnectionState

type StreamerConnectionState string

StreamerConnectionState represents the state of a connection

const (
	StreamerConnectionStateActive       StreamerConnectionState = "ACTIVE"
	StreamerConnectionStateDisconnected StreamerConnectionState = "DISCONNECTED"
	StreamerConnectionStateStale        StreamerConnectionState = "STALE"
)

type StreamerForbiddenError

type StreamerForbiddenError struct {
	ConnectionID string
	Message      string
}

Streamer-compatible error types that match their exact implementation

func (StreamerForbiddenError) Error

func (e StreamerForbiddenError) Error() string

func (StreamerForbiddenError) ErrorCode

func (e StreamerForbiddenError) ErrorCode() string

func (StreamerForbiddenError) HTTPStatusCode

func (e StreamerForbiddenError) HTTPStatusCode() int

func (StreamerForbiddenError) IsRetryable

func (e StreamerForbiddenError) IsRetryable() bool

type StreamerGoneError

type StreamerGoneError struct {
	ConnectionID string
	Message      string
}

Streamer-compatible error types that match their exact implementation

func (StreamerGoneError) Error

func (e StreamerGoneError) Error() string

Error implementations for streamer-compatible errors

func (StreamerGoneError) ErrorCode

func (e StreamerGoneError) ErrorCode() string

func (StreamerGoneError) HTTPStatusCode

func (e StreamerGoneError) HTTPStatusCode() int

func (StreamerGoneError) IsRetryable

func (e StreamerGoneError) IsRetryable() bool

type StreamerInternalServerError

type StreamerInternalServerError struct {
	Message string
}

Streamer-compatible error types that match their exact implementation

func (StreamerInternalServerError) Error

func (StreamerInternalServerError) ErrorCode

func (e StreamerInternalServerError) ErrorCode() string

func (StreamerInternalServerError) HTTPStatusCode

func (e StreamerInternalServerError) HTTPStatusCode() int

func (StreamerInternalServerError) IsRetryable

func (e StreamerInternalServerError) IsRetryable() bool

type StreamerMockConfig

type StreamerMockConfig struct {
	ConnectionTTL    int64         // Connection TTL in seconds (default: 7200 = 2 hours)
	MaxMessageSize   int64         // Maximum message size in bytes (default: 128KB)
	NetworkDelay     time.Duration // Simulate network delays
	DefaultSourceIP  string        // Default connection source IP
	DefaultUserAgent string        // Default connection user agent
}

StreamerMockConfig configures the behavior of the streamer-compatible mock

func DefaultStreamerMockConfig

func DefaultStreamerMockConfig() *StreamerMockConfig

DefaultStreamerMockConfig returns default configuration for streamer mocks

type StreamerMockConnection

type StreamerMockConnection struct {
	ConnectionID string
	ConnectedAt  string
	LastActiveAt string
	SourceIP     string
	UserAgent    string
	State        StreamerConnectionState
	CreatedTime  time.Time
	Metadata     map[string]any
}

StreamerMockConnection represents a WebSocket connection in the streamer-compatible mock

type StreamerPayloadTooLargeError

type StreamerPayloadTooLargeError struct {
	ConnectionID string
	PayloadSize  int
	MaxSize      int
	Message      string
}

Streamer-compatible error types that match their exact implementation

func (StreamerPayloadTooLargeError) Error

func (StreamerPayloadTooLargeError) ErrorCode

func (e StreamerPayloadTooLargeError) ErrorCode() string

func (StreamerPayloadTooLargeError) HTTPStatusCode

func (e StreamerPayloadTooLargeError) HTTPStatusCode() int

func (StreamerPayloadTooLargeError) IsRetryable

func (e StreamerPayloadTooLargeError) IsRetryable() bool

type StreamerThrottlingError

type StreamerThrottlingError struct {
	ConnectionID string
	RetryAfter   int
	Message      string
}

Streamer-compatible error types that match their exact implementation

func (StreamerThrottlingError) Error

func (e StreamerThrottlingError) Error() string

func (StreamerThrottlingError) ErrorCode

func (e StreamerThrottlingError) ErrorCode() string

func (StreamerThrottlingError) HTTPStatusCode

func (e StreamerThrottlingError) HTTPStatusCode() int

func (StreamerThrottlingError) IsRetryable

func (e StreamerThrottlingError) IsRetryable() bool

type TestApp

type TestApp struct {
	// contains filtered or unexported fields
}

TestApp represents a test application instance

func NewTestApp

func NewTestApp() *TestApp

NewTestApp creates a new test application with a default Lift app

func (*TestApp) App

func (ta *TestApp) App() *lift.App

App returns the underlying Lift application for configuration

func (*TestApp) ClearHeaders

func (ta *TestApp) ClearHeaders() *TestApp

ClearHeaders clears all headers

func (*TestApp) DELETE

func (ta *TestApp) DELETE(path string) *TestResponse

DELETE performs a DELETE request

func (*TestApp) GET

func (ta *TestApp) GET(path string, query ...map[string]string) *TestResponse

GET performs a GET request with optional query parameters

func (*TestApp) PATCH

func (ta *TestApp) PATCH(path string, body any) *TestResponse

PATCH performs a PATCH request

func (*TestApp) POST

func (ta *TestApp) POST(path string, body any) *TestResponse

POST performs a POST request

func (*TestApp) PUT

func (ta *TestApp) PUT(path string, body any) *TestResponse

PUT performs a PUT request

func (*TestApp) Start

func (ta *TestApp) Start() error

Start starts the test server

func (*TestApp) Stop

func (ta *TestApp) Stop()

Stop stops the test server

func (*TestApp) WithAuth

func (ta *TestApp) WithAuth(auth *AuthConfig) *TestApp

WithAuth sets authentication for subsequent requests

func (*TestApp) WithHeader

func (ta *TestApp) WithHeader(key, value string) *TestApp

WithHeader adds a header for subsequent requests

func (*TestApp) WithHeaders

func (ta *TestApp) WithHeaders(headers map[string]string) *TestApp

WithHeaders adds multiple headers for subsequent requests

type TestResponse

type TestResponse struct {
	StatusCode int
	Headers    map[string]string
	Body       string
	// contains filtered or unexported fields
}

TestResponse provides enhanced assertion capabilities for HTTP responses

func NewTestResponse

func NewTestResponse(t *testing.T, statusCode int, headers map[string]string, body []byte, err error) *TestResponse

NewTestResponse creates a new TestResponse for testing

func (*TestResponse) AssertBodyContains

func (r *TestResponse) AssertBodyContains(substring string) *TestResponse

AssertBodyContains verifies the response body contains a substring

func (*TestResponse) AssertBodyEquals

func (r *TestResponse) AssertBodyEquals(expected string) *TestResponse

AssertBodyEquals verifies the response body exactly matches

func (*TestResponse) AssertError

func (r *TestResponse) AssertError() *TestResponse

AssertError verifies an error occurred

func (*TestResponse) AssertForbidden

func (r *TestResponse) AssertForbidden() *TestResponse

AssertForbidden verifies forbidden response

func (*TestResponse) AssertHasNextPage

func (r *TestResponse) AssertHasNextPage() *TestResponse

AssertHasNextPage verifies next page link exists

func (*TestResponse) AssertHasPrevPage

func (r *TestResponse) AssertHasPrevPage() *TestResponse

AssertHasPrevPage verifies previous page link exists

func (*TestResponse) AssertHeader

func (r *TestResponse) AssertHeader(key, expected string) *TestResponse

AssertHeader verifies a specific header value

func (*TestResponse) AssertHeaderContains

func (r *TestResponse) AssertHeaderContains(key, substring string) *TestResponse

AssertHeaderContains verifies a header contains a substring

func (*TestResponse) AssertHeaderExists

func (r *TestResponse) AssertHeaderExists(key string) *TestResponse

AssertHeaderExists verifies a header exists

func (*TestResponse) AssertJSONPath

func (r *TestResponse) AssertJSONPath(path string, expected any) *TestResponse

AssertJSONPath verifies a JSON path matches expected value

func (*TestResponse) AssertJSONPathCount

func (r *TestResponse) AssertJSONPathCount(path string, expectedCount int) *TestResponse

AssertJSONPathCount verifies the count of items at a JSON path

func (*TestResponse) AssertJSONPathExists

func (r *TestResponse) AssertJSONPathExists(path string) *TestResponse

AssertJSONPathExists verifies a JSON path exists

func (*TestResponse) AssertJSONPathNotExists

func (r *TestResponse) AssertJSONPathNotExists(path string) *TestResponse

AssertJSONPathNotExists verifies a JSON path does not exist

func (*TestResponse) AssertJSONPaths

func (r *TestResponse) AssertJSONPaths(assertions map[string]any) *TestResponse

AssertJSONPaths verifies multiple JSON paths at once

func (*TestResponse) AssertJSONSchema

func (r *TestResponse) AssertJSONSchema(schema map[string]any) *TestResponse

AssertJSONSchema verifies the response matches a JSON schema (basic validation)

func (*TestResponse) AssertNoError

func (r *TestResponse) AssertNoError() *TestResponse

AssertNoError verifies no error occurred

func (*TestResponse) AssertPagination

func (r *TestResponse) AssertPagination(expectedTotal, expectedPage, expectedPerPage int) *TestResponse

AssertPagination verifies pagination metadata

func (*TestResponse) AssertRateLimitExceeded

func (r *TestResponse) AssertRateLimitExceeded() *TestResponse

AssertRateLimitExceeded verifies a rate limit exceeded response

func (*TestResponse) AssertRateLimitHeaders

func (r *TestResponse) AssertRateLimitHeaders() *TestResponse

AssertRateLimitHeaders verifies standard rate limit headers are present

func (*TestResponse) AssertRateLimitLimit

func (r *TestResponse) AssertRateLimitLimit(expected int) *TestResponse

AssertRateLimitLimit verifies the rate limit value

func (*TestResponse) AssertRateLimitRemaining

func (r *TestResponse) AssertRateLimitRemaining(expected int) *TestResponse

AssertRateLimitRemaining verifies the remaining rate limit count

func (*TestResponse) AssertRequiresAuthentication

func (r *TestResponse) AssertRequiresAuthentication() *TestResponse

AssertRequiresAuthentication verifies authentication is required

func (*TestResponse) AssertResponseTime

func (r *TestResponse) AssertResponseTime(maxDuration string) *TestResponse

AssertResponseTime verifies response was fast enough

func (*TestResponse) AssertStatus

func (r *TestResponse) AssertStatus(expected int) *TestResponse

AssertStatus verifies the HTTP status code

func (*TestResponse) AssertTenantIsolation

func (r *TestResponse) AssertTenantIsolation(tenantID string) *TestResponse

AssertTenantIsolation verifies tenant-specific data isolation

func (*TestResponse) AssertUnauthorized

func (r *TestResponse) AssertUnauthorized() *TestResponse

AssertUnauthorized verifies unauthorized response

func (*TestResponse) AssertValidationError

func (r *TestResponse) AssertValidationError(field string) *TestResponse

AssertValidationError verifies a validation error response

func (*TestResponse) AssertValidationErrors

func (r *TestResponse) AssertValidationErrors(fields []string) *TestResponse

AssertValidationErrors verifies multiple validation errors

func (*TestResponse) Chain

func (r *TestResponse) Chain(fn func(*TestResponse)) *TestResponse

Chain allows for custom assertions

func (*TestResponse) Debug

func (r *TestResponse) Debug() *TestResponse

Debug prints the response for debugging

func (*TestResponse) GetBody

func (r *TestResponse) GetBody() string

GetBody returns the response body as string

func (*TestResponse) GetHeader

func (r *TestResponse) GetHeader(key string) string

GetHeader returns a header value

func (*TestResponse) GetJSONPath

func (r *TestResponse) GetJSONPath(path string) any

GetJSONPath extracts a value from the JSON response

func (*TestResponse) GetStatusCode

func (r *TestResponse) GetStatusCode() int

GetStatusCode returns the HTTP status code

func (*TestResponse) IsSuccess

func (r *TestResponse) IsSuccess() bool

IsSuccess returns true if the status code indicates success (2xx)

func (*TestResponse) JSON

func (r *TestResponse) JSON(target any) error

JSON parses the response body as JSON into the provided interface

func (*TestResponse) ParseJSON

func (r *TestResponse) ParseJSON(target any) error

ParseJSON parses the response body as JSON

type TestScenario

type TestScenario struct {
	Name        string
	Description string
	Setup       func(*TestApp) error
	Request     func(*TestApp) *TestResponse
	Assertions  func(*testing.T, *TestResponse)
	Cleanup     func(*TestApp) error
	Skip        bool
	SkipReason  string
}

TestScenario represents a complete test scenario

func AuthenticationScenarios

func AuthenticationScenarios(endpoint string) []TestScenario

AuthenticationScenarios returns common authentication test scenarios

func CRUDScenarios

func CRUDScenarios(basePath string, createData, updateData map[string]any) []TestScenario

CRUDScenarios returns common CRUD operation test scenarios

func ErrorHandlingScenarios

func ErrorHandlingScenarios() []TestScenario

ErrorHandlingScenarios returns error handling test scenarios

func MultiTenantScenarios

func MultiTenantScenarios(endpoint string) []TestScenario

MultiTenantScenarios returns common multi-tenant test scenarios

func PaginationScenarios

func PaginationScenarios(endpoint string, totalItems int) []TestScenario

PaginationScenarios returns pagination test scenarios

func PerformanceScenarios

func PerformanceScenarios(endpoint string, maxResponseTime time.Duration) []TestScenario

PerformanceScenarios returns performance-related test scenarios

func RateLimitingScenarios

func RateLimitingScenarios(endpoint string, limit int) []TestScenario

RateLimitingScenarios returns common rate limiting test scenarios

func ValidationScenarios

func ValidationScenarios(endpoint string, invalidData map[string]any, expectedErrors []string) []TestScenario

ValidationScenarios returns common validation test scenarios

type TransactionOperation

type TransactionOperation struct {
	Type  string // "put", "delete", etc.
	Table string
	Key   string
	Item  any
}

TransactionOperation represents an operation within a transaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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