filtertest

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientMock

type ClientMock struct {
	// CheckerFunc mocks the Checker method.
	CheckerFunc func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error

	// GetOutputBytesFunc mocks the GetOutputBytes method.
	GetOutputBytesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error)

	// UpdateFilterOutputBytesFunc mocks the UpdateFilterOutputBytes method.
	UpdateFilterOutputBytesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error
	// contains filtered or unexported fields
}

ClientMock is a mock implementation of filter.Client.

func TestSomethingThatUsesClient(t *testing.T) {

	// make and configure a mocked filter.Client
	mockedClient := &ClientMock{
		CheckerFunc: func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error {
			panic("mock out the Checker method")
		},
		GetOutputBytesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error) {
			panic("mock out the GetOutputBytes method")
		},
		UpdateFilterOutputBytesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error {
			panic("mock out the UpdateFilterOutputBytes method")
		},
	}

	// use mockedClient in code that requires filter.Client
	// and then make assertions.

}

func (*ClientMock) Checker added in v1.25.0

func (mock *ClientMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error

Checker calls CheckerFunc.

func (*ClientMock) CheckerCalls added in v1.25.0

func (mock *ClientMock) CheckerCalls() []struct {
	ContextMoqParam context.Context
	CheckState      *healthcheck.CheckState
}

CheckerCalls gets all the calls that were made to Checker. Check the length with:

len(mockedClient.CheckerCalls())

func (*ClientMock) GetOutputBytes

func (mock *ClientMock) GetOutputBytes(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error)

GetOutputBytes calls GetOutputBytesFunc.

func (*ClientMock) GetOutputBytesCalls

func (mock *ClientMock) GetOutputBytesCalls() []struct {
	Ctx                  context.Context
	UserAuthToken        string
	ServiceAuthToken     string
	DownloadServiceToken string
	CollectionID         string
	FilterOutputID       string
}

GetOutputBytesCalls gets all the calls that were made to GetOutputBytes. Check the length with:

len(mockedClient.GetOutputBytesCalls())

func (*ClientMock) UpdateFilterOutputBytes

func (mock *ClientMock) UpdateFilterOutputBytes(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error

UpdateFilterOutputBytes calls UpdateFilterOutputBytesFunc.

func (*ClientMock) UpdateFilterOutputBytesCalls

func (mock *ClientMock) UpdateFilterOutputBytesCalls() []struct {
	Ctx                  context.Context
	UserAuthToken        string
	ServiceAuthToken     string
	DownloadServiceToken string
	FilterJobID          string
	B                    []byte
}

UpdateFilterOutputBytesCalls gets all the calls that were made to UpdateFilterOutputBytes. Check the length with:

len(mockedClient.UpdateFilterOutputBytesCalls())

Jump to

Keyboard shortcuts

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