test

package
v1.5.0-alpha12 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBoltDB

func CreateBoltDB(t *testing.T) *bbolt.DB

CreateBoltDB creates a new BoltDB database for testing

func CreateSerializer

func CreateSerializer(t *testing.T) *watcher.JSONSerializer

CreateSerializer creates a new JSONSerializer for testing

func EventWithSeqNum

func EventWithSeqNum(seqNum uint64) gomock.Matcher

EventWithSeqNum is a matcher that matches an event with a specific sequence number

Types

type EventStoreWrapper

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

EventStoreWrapper provides a way to intercept and modify the behavior of an EventStore for testing purposes. It wraps an actual EventStore and allows setting interceptors for each method.

func NewEventStoreWrapper

func NewEventStoreWrapper(actualStore watcher.EventStore) *EventStoreWrapper

func (*EventStoreWrapper) Close

func (w *EventStoreWrapper) Close(ctx context.Context) error

func (*EventStoreWrapper) GetCheckpoint

func (w *EventStoreWrapper) GetCheckpoint(ctx context.Context, watcherID string) (uint64, error)

func (*EventStoreWrapper) GetEvents

func (*EventStoreWrapper) GetLatestEventNum

func (w *EventStoreWrapper) GetLatestEventNum(ctx context.Context) (uint64, error)

func (*EventStoreWrapper) StoreCheckpoint

func (w *EventStoreWrapper) StoreCheckpoint(ctx context.Context, watcherID string, eventSeqNum uint64) error

func (*EventStoreWrapper) StoreEvent

func (w *EventStoreWrapper) StoreEvent(ctx context.Context, operation watcher.Operation, objectType string, object interface{}) error

func (*EventStoreWrapper) WithCloseInterceptor

func (w *EventStoreWrapper) WithCloseInterceptor(f Interceptor) *EventStoreWrapper

func (*EventStoreWrapper) WithGetCheckpointInterceptor

func (w *EventStoreWrapper) WithGetCheckpointInterceptor(f Interceptor) *EventStoreWrapper

func (*EventStoreWrapper) WithGetEventsInterceptor

func (w *EventStoreWrapper) WithGetEventsInterceptor(f Interceptor) *EventStoreWrapper

func (*EventStoreWrapper) WithGetLatestEventInterceptor

func (w *EventStoreWrapper) WithGetLatestEventInterceptor(f Interceptor) *EventStoreWrapper

func (*EventStoreWrapper) WithStoreCheckpointInterceptor

func (w *EventStoreWrapper) WithStoreCheckpointInterceptor(f Interceptor) *EventStoreWrapper

func (*EventStoreWrapper) WithStoreEventInterceptor

func (w *EventStoreWrapper) WithStoreEventInterceptor(f Interceptor) *EventStoreWrapper

type Interceptor

type Interceptor func() error

type TestObject

type TestObject struct {
	Name  string
	Value int
}

Jump to

Keyboard shortcuts

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