application

package
v0.0.0-...-29e51a2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(elems []string, sep string, mod func(string) string) string

Types

type IntegrationIncident

type IntegrationIncident interface {
	DeviceStateUpdated(ctx context.Context, deviceId string, statusMessage models.StatusMessage) error
	LifebuoyValueUpdated(ctx context.Context, deviceId, deviceValue string) error
	SewageOverflowObserved(ctx context.Context, functionUpdated models.FunctionUpdated) error
}

func NewApplication

func NewApplication(_ context.Context, incidentReporter incident.ReporterFunc, entityLocator services.EntityLocator) IntegrationIncident

type IntegrationIncidentMock

type IntegrationIncidentMock struct {
	// DeviceStateUpdatedFunc mocks the DeviceStateUpdated method.
	DeviceStateUpdatedFunc func(ctx context.Context, deviceId string, statusMessage models.StatusMessage) error

	// LifebuoyValueUpdatedFunc mocks the LifebuoyValueUpdated method.
	LifebuoyValueUpdatedFunc func(ctx context.Context, deviceId string, deviceValue string) error

	// SewageOverflowObservedFunc mocks the SewageOverflowObserved method.
	SewageOverflowObservedFunc func(ctx context.Context, functionUpdated models.FunctionUpdated) error
	// contains filtered or unexported fields
}

IntegrationIncidentMock is a mock implementation of IntegrationIncident.

func TestSomethingThatUsesIntegrationIncident(t *testing.T) {

	// make and configure a mocked IntegrationIncident
	mockedIntegrationIncident := &IntegrationIncidentMock{
		DeviceStateUpdatedFunc: func(ctx context.Context, deviceId string, statusMessage models.StatusMessage) error {
			panic("mock out the DeviceStateUpdated method")
		},
		LifebuoyValueUpdatedFunc: func(ctx context.Context, deviceId string, deviceValue string) error {
			panic("mock out the LifebuoyValueUpdated method")
		},
		SewageOverflowObservedFunc: func(ctx context.Context, functionUpdated models.FunctionUpdated) error {
			panic("mock out the SewageOverflowObserved method")
		},
	}

	// use mockedIntegrationIncident in code that requires IntegrationIncident
	// and then make assertions.

}

func (*IntegrationIncidentMock) DeviceStateUpdated

func (mock *IntegrationIncidentMock) DeviceStateUpdated(ctx context.Context, deviceId string, statusMessage models.StatusMessage) error

DeviceStateUpdated calls DeviceStateUpdatedFunc.

func (*IntegrationIncidentMock) DeviceStateUpdatedCalls

func (mock *IntegrationIncidentMock) DeviceStateUpdatedCalls() []struct {
	Ctx           context.Context
	DeviceId      string
	StatusMessage models.StatusMessage
}

DeviceStateUpdatedCalls gets all the calls that were made to DeviceStateUpdated. Check the length with:

len(mockedIntegrationIncident.DeviceStateUpdatedCalls())

func (*IntegrationIncidentMock) LifebuoyValueUpdated

func (mock *IntegrationIncidentMock) LifebuoyValueUpdated(ctx context.Context, deviceId string, deviceValue string) error

LifebuoyValueUpdated calls LifebuoyValueUpdatedFunc.

func (*IntegrationIncidentMock) LifebuoyValueUpdatedCalls

func (mock *IntegrationIncidentMock) LifebuoyValueUpdatedCalls() []struct {
	Ctx         context.Context
	DeviceId    string
	DeviceValue string
}

LifebuoyValueUpdatedCalls gets all the calls that were made to LifebuoyValueUpdated. Check the length with:

len(mockedIntegrationIncident.LifebuoyValueUpdatedCalls())

func (*IntegrationIncidentMock) SewageOverflowObserved

func (mock *IntegrationIncidentMock) SewageOverflowObserved(ctx context.Context, functionUpdated models.FunctionUpdated) error

SewageOverflowObserved calls SewageOverflowObservedFunc.

func (*IntegrationIncidentMock) SewageOverflowObservedCalls

func (mock *IntegrationIncidentMock) SewageOverflowObservedCalls() []struct {
	Ctx             context.Context
	FunctionUpdated models.FunctionUpdated
}

SewageOverflowObservedCalls gets all the calls that were made to SewageOverflowObserved. Check the length with:

len(mockedIntegrationIncident.SewageOverflowObservedCalls())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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