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())
Click to show internal directories.
Click to hide internal directories.