roadaccidents

package
v0.0.0-...-bf700c2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviationTypeRoadAccident string = "roadAccident"
)

Variables

View Source
var ErrAlreadyExists = errors.New("already exists")

Functions

This section is empty.

Types

type RoadAccidentSvc

type RoadAccidentSvc interface {
	Start(ctx context.Context) error
	// contains filtered or unexported methods
}

func NewService

func NewService(authKey, tfvURL, countyCode string, ctxBroker client.ContextBrokerClient) RoadAccidentSvc

type RoadAccidentSvcMock

type RoadAccidentSvcMock struct {
	// StartFunc mocks the Start method.
	StartFunc func(ctx context.Context) error
	// contains filtered or unexported fields
}

RoadAccidentSvcMock is a mock implementation of RoadAccidentSvc.

func TestSomethingThatUsesRoadAccidentSvc(t *testing.T) {

	// make and configure a mocked RoadAccidentSvc
	mockedRoadAccidentSvc := &RoadAccidentSvcMock{
		StartFunc: func(ctx context.Context) error {
			panic("mock out the Start method")
		},
		getAndPublishRoadAccidentsFunc: func(ctx context.Context, lastChangeID string) (string, error) {
			panic("mock out the getAndPublishRoadAccidents method")
		},
		getRoadAccidentsFromTFVFunc: func(ctx context.Context, lastChangeID string) ([]byte, error) {
			panic("mock out the getRoadAccidentsFromTFV method")
		},
		publishRoadAccidentToContextBrokerFunc: func(ctx context.Context, dev tfvDeviation, deleted bool) error {
			panic("mock out the publishRoadAccidentToContextBroker method")
		},
	}

	// use mockedRoadAccidentSvc in code that requires RoadAccidentSvc
	// and then make assertions.

}

func (*RoadAccidentSvcMock) Start

func (mock *RoadAccidentSvcMock) Start(ctx context.Context) error

Start calls StartFunc.

func (*RoadAccidentSvcMock) StartCalls

func (mock *RoadAccidentSvcMock) StartCalls() []struct {
	Ctx context.Context
}

StartCalls gets all the calls that were made to Start. Check the length with:

len(mockedRoadAccidentSvc.StartCalls())

Jump to

Keyboard shortcuts

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