testing

package
v1.5.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePorts added in v1.5.0

func GetFreePorts(num uint) ([]int, error)

GetFreePorts asks the kernel for `num` free open ports that are ready to use. This code is retrofitted from freeport.GetFreePort().

func WaitForListeningAddress added in v1.5.0

func WaitForListeningAddress(t *testing.T, timeout time.Duration, addresses ...string)

WaitForListeningAddress waits for `addresses` to be listening for up to `timeout`.

Types

type Event

type Event struct {
	EventName   string        `json:"eventName,omitempty"`
	To          []string      `json:"to,omitempty"`
	Concurrency string        `json:"concurrency,omitempty"`
	CreatedAt   time.Time     `json:"createdAt,omitempty"`
	State       []KeyValState `json:"state,omitempty"`
	Data        interface{}   `json:"data,omitempty"`
}

Event is an app response event.

type FakeSecretStore added in v0.11.0

type FakeSecretStore struct{}

func (FakeSecretStore) BulkGetSecret added in v1.0.0

func (FakeSecretStore) Close added in v1.2.0

func (c FakeSecretStore) Close() error

func (FakeSecretStore) GetSecret added in v0.11.0

func (FakeSecretStore) Init added in v0.11.0

func (c FakeSecretStore) Init(metadata secretstores.Metadata) error

type KeyValState

type KeyValState struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

KeyValState is a key value struct for state.

type MockActors

type MockActors struct {
	mock.Mock
}

MockActors is an autogenerated mock type for the Actors type

func (*MockActors) Call

Call provides a mock function with given fields: req

func (*MockActors) CreateReminder

func (_m *MockActors) CreateReminder(ctx context.Context, req *actors.CreateReminderRequest) error

CreateReminder provides a mock function with given fields: req

func (*MockActors) CreateTimer

func (_m *MockActors) CreateTimer(ctx context.Context, req *actors.CreateTimerRequest) error

CreateTimer provides a mock function with given fields: req

func (*MockActors) DeleteReminder

func (_m *MockActors) DeleteReminder(ctx context.Context, req *actors.DeleteReminderRequest) error

DeleteReminder provides a mock function with given fields: req

func (*MockActors) DeleteTimer

func (_m *MockActors) DeleteTimer(ctx context.Context, req *actors.DeleteTimerRequest) error

DeleteTimer provides a mock function with given fields: req

func (*MockActors) GetActiveActorsCount added in v0.5.0

func (_m *MockActors) GetActiveActorsCount(ctx context.Context) []actors.ActiveActorsCount

GetActiveActorsCount provides a mock function

func (*MockActors) GetReminder

func (_m *MockActors) GetReminder(ctx context.Context, req *actors.GetReminderRequest) (*actors.Reminder, error)

GetReminder provides a mock function with given fields: req

func (*MockActors) GetState

GetState provides a mock function with given fields: req

func (*MockActors) Init

func (_m *MockActors) Init() error

Init provides a mock function with given fields:

func (*MockActors) IsActorHosted

func (_m *MockActors) IsActorHosted(ctx context.Context, req *actors.ActorHostedRequest) bool

IsActorHosted provides a mock function with given fields: req

func (*MockActors) Stop added in v1.0.0

func (_m *MockActors) Stop()

Stop provides a mock function with given fields:

func (*MockActors) TransactionalStateOperation

func (_m *MockActors) TransactionalStateOperation(ctx context.Context, req *actors.TransactionalRequest) error

TransactionalStateOperation provides a mock function with given fields: req

type MockApp

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

MockApp is a mock for an app.

func NewMockApp

func NewMockApp(returnBody bool, messageCount int, noprint bool) *MockApp

NewMockApp returns a new mocked app.

func (*MockApp) Run

func (a *MockApp) Run(port int)

Run opens a test HTTP server and echo endpoint on the mock object.

type MockBinding added in v1.0.0

type MockBinding struct {
	mock.Mock
}

MockBinding is a mock input/output component object.

func (*MockBinding) Close added in v1.2.0

func (m *MockBinding) Close() error

func (*MockBinding) Init added in v1.0.0

func (m *MockBinding) Init(metadata bindings.Metadata) error

Init is a mock initialization method.

func (*MockBinding) Invoke added in v1.0.0

Invoke is a mock invoke method.

func (*MockBinding) Operations added in v1.0.0

func (m *MockBinding) Operations() []bindings.OperationKind

Operations is a mock operations method.

func (*MockBinding) Read added in v1.0.0

func (m *MockBinding) Read(handler func(*bindings.ReadResponse) ([]byte, error)) error

Read is a mock read method.

type MockDirectMessaging

type MockDirectMessaging struct {
	mock.Mock
}

MockDirectMessaging is an autogenerated mock type for the MockDirectMessaging type

func (*MockDirectMessaging) Close added in v1.2.0

func (_m *MockDirectMessaging) Close() error

func (*MockDirectMessaging) Invoke

Invoke provides a mock function with given fields: ctx, targetAppID, req

type MockPubSub

type MockPubSub struct {
	mock.Mock
}

MockPubSub is a mock pub-sub component object.

func (*MockPubSub) Close added in v1.0.0

func (m *MockPubSub) Close() error

func (*MockPubSub) Features added in v1.0.0

func (m *MockPubSub) Features() []pubsub.Feature

func (*MockPubSub) Init

func (m *MockPubSub) Init(metadata pubsub.Metadata) error

Init is a mock initialization method.

func (*MockPubSub) Publish

func (m *MockPubSub) Publish(req *pubsub.PublishRequest) error

Publish is a mock publish method.

func (*MockPubSub) Subscribe

func (m *MockPubSub) Subscribe(req pubsub.SubscribeRequest, handler pubsub.Handler) error

Subscribe is a mock subscribe method.

type MockPubSubAdapter added in v1.0.0

type MockPubSubAdapter struct {
	PublishFn   func(req *pubsub.PublishRequest) error
	GetPubSubFn func(pubsubName string) pubsub.PubSub
}

MockPubSubAdapter is mock for PubSubAdapter

func (*MockPubSubAdapter) GetPubSub added in v1.0.0

func (a *MockPubSubAdapter) GetPubSub(pubsubName string) pubsub.PubSub

GetPubSub is an adapter method to fetch a pubsub

func (*MockPubSubAdapter) Publish added in v1.0.0

func (a *MockPubSubAdapter) Publish(req *pubsub.PublishRequest) error

Publish is an adapter method for the runtime to pre-validate publish requests And then forward them to the Pub/Sub component. This method is used by the HTTP and gRPC APIs.

type MockQuerier added in v1.5.0

type MockQuerier struct {
	mock.Mock
}

MockQuerier is an autogenerated mock type for the Querier type

func (*MockQuerier) Query added in v1.5.0

func (_m *MockQuerier) Query(req *state.QueryRequest) (*state.QueryResponse, error)

Query provides a mock function with given fields: req

type MockResolver added in v1.2.0

type MockResolver struct {
	mock.Mock
}

MockResolver is a mock nameresolution component object.

func (*MockResolver) Init added in v1.2.0

func (m *MockResolver) Init(metadata nr.Metadata) error

Init is a mock initialization method.

func (*MockResolver) ResolveID added in v1.2.0

func (m *MockResolver) ResolveID(req nr.ResolveRequest) (string, error)

ResolveID is a mock resolve method.

type MockStateStore added in v1.0.0

type MockStateStore struct {
	mock.Mock
}

MockStateStore is an autogenerated mock type for the Store type

func (*MockStateStore) BulkDelete added in v1.0.0

func (_m *MockStateStore) BulkDelete(req []state.DeleteRequest) error

BulkDelete provides a mock function with given fields: req

func (*MockStateStore) BulkGet added in v1.0.0

func (_m *MockStateStore) BulkGet(req []state.GetRequest) (bool, []state.BulkGetResponse, error)

func (*MockStateStore) BulkSet added in v1.0.0

func (_m *MockStateStore) BulkSet(req []state.SetRequest) error

BulkSet provides a mock function with given fields: req

func (*MockStateStore) Close added in v1.2.0

func (_m *MockStateStore) Close() error

func (*MockStateStore) Delete added in v1.0.0

func (_m *MockStateStore) Delete(req *state.DeleteRequest) error

Delete provides a mock function with given fields: req

func (*MockStateStore) Features added in v1.1.0

func (_m *MockStateStore) Features() []state.Feature

Features returns the features for this state store.

func (*MockStateStore) Get added in v1.0.0

Get provides a mock function with given fields: req

func (*MockStateStore) Init added in v1.0.0

func (_m *MockStateStore) Init(metadata state.Metadata) error

Init provides a mock function with given fields: metadata

func (*MockStateStore) Ping added in v1.3.0

func (_m *MockStateStore) Ping() error

Ping provides a mock function

func (*MockStateStore) Set added in v1.0.0

func (_m *MockStateStore) Set(req *state.SetRequest) error

Set provides a mock function with given fields: req

type TransactionalStoreMock added in v1.0.0

type TransactionalStoreMock struct {
	MockStateStore
}

func (*TransactionalStoreMock) Close added in v1.2.0

func (_m *TransactionalStoreMock) Close() error

func (*TransactionalStoreMock) Features added in v1.1.0

func (_m *TransactionalStoreMock) Features() []state.Feature

func (*TransactionalStoreMock) Multi added in v1.0.0

Code generated by mockery v2.3.0. DO NOT EDIT.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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