mocks

package
v0.0.0-...-c9206f4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNoRequestsMade

func AssertNoRequestsMade(t *testing.T, mock *MockDynamo, msg string, f func())

AssertNoRequestsMade will Execute a function, asserting that no requests are made over the course of the function.

func AssertRequestMade

func AssertRequestMade(t *testing.T, mock *MockDynamo, msg string, f func())

AssertRequestMade will Execute a function, asserting that at least one request is made over the course of the function.

func NewMockDynamo

func NewMockDynamo(tables []string) dynamodbiface.DynamoDBAPI

NewMockDynamo gets a dynamo interface for testing

Types

type DataAccessLayer

type DataAccessLayer struct {
	mock.Mock
}

DataAccessLayer is an autogenerated mock type for the DataAccessLayer type

func (*DataAccessLayer) Find

func (_m *DataAccessLayer) Find(filter interface{}) ([]map[string]interface{}, error)

Find provides a mock function with given fields: filter

type MockDynamo

type MockDynamo struct {
	dynamodbiface.DynamoDBAPI
	// contains filtered or unexported fields
}

MockDynamo mocks the DynamoDB API in memory. It only supports GetItem, PutItem, and ScanPages. It only supports the most simple filter expressions: they must be of the form <column> <operator> :<value>, and operator must be =, <, <=, >, >=, or <>.

func (*MockDynamo) GetItem

func (d *MockDynamo) GetItem(in *dynamodb.GetItemInput) (out *dynamodb.GetItemOutput, err error)

GetItem mocks the dynamo GetItem method

func (*MockDynamo) PutItem

func (d *MockDynamo) PutItem(in *dynamodb.PutItemInput) (out *dynamodb.PutItemOutput, err error)

PutItem mocks the dynamo PutItem method

func (*MockDynamo) ScanPages

func (d *MockDynamo) ScanPages(in *dynamodb.ScanInput, pager func(*dynamodb.ScanOutput, bool) bool) (err error)

ScanPages mocks the dynamo ScanPages method

func (*MockDynamo) UpdateItem

func (d *MockDynamo) UpdateItem(in *dynamodb.UpdateItemInput) (out *dynamodb.UpdateItemOutput, err error)

UpdateItem mocks the dynamo UpdateItem method

Jump to

Keyboard shortcuts

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