teststate

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

* Copyright (c) 2024-present unTill Software Development Group B. V. * @author Michael Saigachenko

* Copyright (c) 2024-present unTill Software Development Group B. V. * @author Michael Saigachenko

* Copyright (c) 2024-present unTill Software Development Group B. V. * @author Michael Saigachenko

* Copyright (c) 2024-present unTill Software Development Group B. V. * @author Michael Saigachenko

Index

Constants

View Source
const (
	ProcKind_Actualizer = iota
	ProcKind_CommandProcessor
	ProcKind_QueryProcessor
)
View Source
const (
	TestPkgAlias  = "tstpkg"
	TestPartition = istructs.PartitionID(1)
)

Variables

View Source
var AppQName_test = istructs.NewAppQName("test", "app")
View Source
var BundlesLimit = 10
View Source
var IntentsLimit = 10

Functions

This section is empty.

Types

type HttpHandlerFunc

type HttpHandlerFunc func(req HttpRequest) (resp HttpResponse, err error)

type HttpRequest

type HttpRequest struct {
	Timeout time.Duration
	Method  string
	URL     string
	Body    io.Reader
	Headers map[string]string
}

type HttpResponse

type HttpResponse struct {
	Status  int
	Body    []byte
	Headers map[string][]string
}

type IIntentAssertions

type IIntentAssertions interface {
	Exists()
	Equal(vb ValueBuilderCallback)
}

type ITestAPI

type ITestAPI interface {
	// State
	PutEvent(wsid istructs.WSID, name appdef.FullQName, cb NewEventCallback) (wLogOffs istructs.Offset, newRecordIds []istructs.RecordID)
	PutView(testWSID istructs.WSID, entity appdef.FullQName, callback ViewValueCallback)
	PutSecret(name string, secret []byte)
	PutHttpHandler(HttpHandlerFunc)
	PutRequestSubject(principals []iauthnz.Principal, token string)
	PutQuery(wsid istructs.WSID, name appdef.FullQName)

	// Intent
	RequireIntent(t *testing.T, storage appdef.QName, entity appdef.FullQName, kb KeyBuilderCallback) IIntentAssertions
}

type ITestState

type ITestState interface {
	state.IState
	ITestAPI
}

func NewTestState

func NewTestState(processorKind int, packagePath string, createWorkspaces ...TestWorkspace) ITestState

type KeyBuilderCallback

type KeyBuilderCallback func(key istructs.IStateKeyBuilder)

type NewEventCallback

type NewEventCallback func(argBuilder istructs.IObjectBuilder, cudBuilder istructs.ICUD)

type TestViewValue

type TestViewValue struct {
	Key istructs.IKeyBuilder
	Val istructs.IValueBuilder
	// contains filtered or unexported fields
}

type TestWorkspace

type TestWorkspace struct {
	WorkspaceDescriptor string
	WSID                istructs.WSID
}

type ValueBuilderCallback

type ValueBuilderCallback func(value istructs.IStateValueBuilder)

type ViewValueCallback

type ViewValueCallback func(key istructs.IKeyBuilder, value istructs.IValueBuilder)

Jump to

Keyboard shortcuts

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