testhelper

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionGet    = "GET"
	ResourceHrUs = "/humanresources/us"
	MembersHrUs  = "Read.HRUS"
)
View Source
const AttrMembersPlaceholder = ":MembersX"
View Source
const AttrNameActions = "ActionsX"
View Source
const AttrNameExprMembers = "#MembersX"
View Source
const AttrNameMembers = "MembersX"
View Source
const AttrNameResource = "ResourceX"
View Source
const DynamicTableDefinitionJson = `` /* 365-byte string literal not displayed */
View Source
const TestAwsAccessKeyId = "anAccessKeyID"
View Source
const TestAwsRegion = "us-west-1"
View Source
const TestAwsSecretAccessKey = "aSecretAccessKey"

Variables

View Source
var TableName = "TestDynamodbTable"

Functions

func AttributeDefinitions

func AttributeDefinitions() (resDef, actionsDef, membersDef *table.AttributeDefinition)

func AwsCredentialsForTest

func AwsCredentialsForTest() []byte

func CustomResourceActionRoles

func CustomResourceActionRoles(res, action string, members []string) rar.ResourceActionRoles

func CustomScanOutputWithAttributeNames

func CustomScanOutputWithAttributeNames(rarList ...rar.ResourceActionRoles) *ddb.ScanOutput

func DynamicTableDefinition

func DynamicTableDefinition() table.TableDefinition

func MakeResourceActionRoles

func MakeResourceActionRoles() rar.ResourceActionRoles

func ScanOutput

func ScanOutput() *ddb.ScanOutput

func SimpleTableInfo

func SimpleTableInfo() *table.TableInfo[SimpleDynamodbItem]

Types

type MockClient

type MockClient struct {
	mock.Mock
}

func NewMockClient

func NewMockClient() *MockClient

func (*MockClient) ExpectScan

func (m *MockClient) ExpectScan(andRetError error, orRetItems ...rar.ResourceActionRoles)

func (*MockClient) ExpectUpdateItem

func (m *MockClient) ExpectUpdateItem(withInput rar.ResourceActionRoles, andRetError error)

func (*MockClient) Scan

func (m *MockClient) Scan(ctx context.Context, params *ddb.ScanInput, optFns ...func(*ddb.Options)) (*ddb.ScanOutput, error)

func (*MockClient) UpdateItem

func (m *MockClient) UpdateItem(ctx context.Context, params *ddb.UpdateItemInput, optFns ...func(*ddb.Options)) (*ddb.UpdateItemOutput, error)

type MockDynamodbHttpClient

type MockDynamodbHttpClient struct {
	mock.Mock
}

func NewMockDynamodbHttpClient

func NewMockDynamodbHttpClient() *MockDynamodbHttpClient

func (*MockDynamodbHttpClient) Do

func (*MockDynamodbHttpClient) ExpectScan

func (m *MockDynamodbHttpClient) ExpectScan(withRespErr error, orRespItems ...rar.ResourceActionRoles)

func (*MockDynamodbHttpClient) ExpectUpdateItem

func (m *MockDynamodbHttpClient) ExpectUpdateItem(withReq rar.ResourceActionRoles, respWithErr error)

type SimpleDynamodbItem

type SimpleDynamodbItem struct {
	ResourceX string `json:"ResourceX" meta:"resource,pk"`
	ActionsX  string `json:"ActionsX" meta:"actions,sk"`
	MembersX  string `json:"MembersX" meta:"members"`
}

func (SimpleDynamodbItem) MapTo

Jump to

Keyboard shortcuts

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