mocks

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClienterMock

type ClienterMock struct {
	// CheckerFunc mocks the Checker method.
	CheckerFunc func(ctx context.Context, check *health.CheckState) error

	// GetNavigationPublicFunc mocks the GetNavigationPublic method.
	GetNavigationPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, apiError.Error)

	// GetRootTopicsPrivateFunc mocks the GetRootTopicsPrivate method.
	GetRootTopicsPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, apiError.Error)

	// GetRootTopicsPublicFunc mocks the GetRootTopicsPublic method.
	GetRootTopicsPublicFunc func(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, apiError.Error)

	// GetSubtopicsPrivateFunc mocks the GetSubtopicsPrivate method.
	GetSubtopicsPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, apiError.Error)

	// GetSubtopicsPublicFunc mocks the GetSubtopicsPublic method.
	GetSubtopicsPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, apiError.Error)

	// GetTopicPrivateFunc mocks the GetTopicPrivate method.
	GetTopicPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, apiError.Error)

	// GetTopicPublicFunc mocks the GetTopicPublic method.
	GetTopicPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, apiError.Error)

	// HealthFunc mocks the Health method.
	HealthFunc func() *healthcheck.Client

	// PutTopicPrivateFunc mocks the PutTopicPrivate method.
	PutTopicPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string, topicUpdate []byte) (*sdk.ResponseInfo, apiError.Error)

	// PutTopicReleasePrivateFunc mocks the PutTopicReleasePrivate method.
	PutTopicReleasePrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, apiError.Error)

	// PutTopicStatePrivateFunc mocks the PutTopicStatePrivate method.
	PutTopicStatePrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string, topicState string) (*sdk.ResponseInfo, apiError.Error)

	// URLFunc mocks the URL method.
	URLFunc func() string
	// contains filtered or unexported fields
}

ClienterMock is a mock implementation of sdk.Clienter.

func TestSomethingThatUsesClienter(t *testing.T) {

	// make and configure a mocked sdk.Clienter
	mockedClienter := &ClienterMock{
		CheckerFunc: func(ctx context.Context, check *health.CheckState) error {
			panic("mock out the Checker method")
		},
		GetNavigationPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, apiError.Error) {
			panic("mock out the GetNavigationPublic method")
		},
		GetRootTopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, apiError.Error) {
			panic("mock out the GetRootTopicsPrivate method")
		},
		GetRootTopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, apiError.Error) {
			panic("mock out the GetRootTopicsPublic method")
		},
		GetSubtopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, apiError.Error) {
			panic("mock out the GetSubtopicsPrivate method")
		},
		GetSubtopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, apiError.Error) {
			panic("mock out the GetSubtopicsPublic method")
		},
		GetTopicPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, apiError.Error) {
			panic("mock out the GetTopicPrivate method")
		},
		GetTopicPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, apiError.Error) {
			panic("mock out the GetTopicPublic method")
		},
		HealthFunc: func() *healthcheck.Client {
			panic("mock out the Health method")
		},
		PutTopicPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string, topicUpdate []byte) (*sdk.ResponseInfo, apiError.Error) {
			panic("mock out the PutTopicPrivate method")
		},
		PutTopicReleasePrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, apiError.Error) {
			panic("mock out the PutTopicReleasePrivate method")
		},
		PutTopicStatePrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string, topicState string) (*sdk.ResponseInfo, apiError.Error) {
			panic("mock out the PutTopicStatePrivate method")
		},
		URLFunc: func() string {
			panic("mock out the URL method")
		},
	}

	// use mockedClienter in code that requires sdk.Clienter
	// and then make assertions.

}

func (*ClienterMock) Checker

func (mock *ClienterMock) Checker(ctx context.Context, check *health.CheckState) error

Checker calls CheckerFunc.

func (*ClienterMock) CheckerCalls

func (mock *ClienterMock) CheckerCalls() []struct {
	Ctx   context.Context
	Check *health.CheckState
}

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

len(mockedClienter.CheckerCalls())

func (*ClienterMock) GetNavigationPublic added in v0.12.0

func (mock *ClienterMock) GetNavigationPublic(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, apiError.Error)

GetNavigationPublic calls GetNavigationPublicFunc.

func (*ClienterMock) GetNavigationPublicCalls added in v0.12.0

func (mock *ClienterMock) GetNavigationPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	Options    sdk.Options
}

GetNavigationPublicCalls gets all the calls that were made to GetNavigationPublic. Check the length with:

len(mockedClienter.GetNavigationPublicCalls())

func (*ClienterMock) GetRootTopicsPrivate

func (mock *ClienterMock) GetRootTopicsPrivate(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, apiError.Error)

GetRootTopicsPrivate calls GetRootTopicsPrivateFunc.

func (*ClienterMock) GetRootTopicsPrivateCalls

func (mock *ClienterMock) GetRootTopicsPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
}

GetRootTopicsPrivateCalls gets all the calls that were made to GetRootTopicsPrivate. Check the length with:

len(mockedClienter.GetRootTopicsPrivateCalls())

func (*ClienterMock) GetRootTopicsPublic

func (mock *ClienterMock) GetRootTopicsPublic(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, apiError.Error)

GetRootTopicsPublic calls GetRootTopicsPublicFunc.

func (*ClienterMock) GetRootTopicsPublicCalls

func (mock *ClienterMock) GetRootTopicsPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
}

GetRootTopicsPublicCalls gets all the calls that were made to GetRootTopicsPublic. Check the length with:

len(mockedClienter.GetRootTopicsPublicCalls())

func (*ClienterMock) GetSubtopicsPrivate

func (mock *ClienterMock) GetSubtopicsPrivate(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, apiError.Error)

GetSubtopicsPrivate calls GetSubtopicsPrivateFunc.

func (*ClienterMock) GetSubtopicsPrivateCalls

func (mock *ClienterMock) GetSubtopicsPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetSubtopicsPrivateCalls gets all the calls that were made to GetSubtopicsPrivate. Check the length with:

len(mockedClienter.GetSubtopicsPrivateCalls())

func (*ClienterMock) GetSubtopicsPublic

func (mock *ClienterMock) GetSubtopicsPublic(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, apiError.Error)

GetSubtopicsPublic calls GetSubtopicsPublicFunc.

func (*ClienterMock) GetSubtopicsPublicCalls

func (mock *ClienterMock) GetSubtopicsPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetSubtopicsPublicCalls gets all the calls that were made to GetSubtopicsPublic. Check the length with:

len(mockedClienter.GetSubtopicsPublicCalls())

func (*ClienterMock) GetTopicPrivate added in v0.13.4

func (mock *ClienterMock) GetTopicPrivate(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, apiError.Error)

GetTopicPrivate calls GetTopicPrivateFunc.

func (*ClienterMock) GetTopicPrivateCalls added in v0.13.4

func (mock *ClienterMock) GetTopicPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetTopicPrivateCalls gets all the calls that were made to GetTopicPrivate. Check the length with:

len(mockedClienter.GetTopicPrivateCalls())

func (*ClienterMock) GetTopicPublic added in v0.13.4

func (mock *ClienterMock) GetTopicPublic(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, apiError.Error)

GetTopicPublic calls GetTopicPublicFunc.

func (*ClienterMock) GetTopicPublicCalls added in v0.13.4

func (mock *ClienterMock) GetTopicPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetTopicPublicCalls gets all the calls that were made to GetTopicPublic. Check the length with:

len(mockedClienter.GetTopicPublicCalls())

func (*ClienterMock) Health

func (mock *ClienterMock) Health() *healthcheck.Client

Health calls HealthFunc.

func (*ClienterMock) HealthCalls

func (mock *ClienterMock) HealthCalls() []struct {
}

HealthCalls gets all the calls that were made to Health. Check the length with:

len(mockedClienter.HealthCalls())

func (*ClienterMock) PutTopicPrivate added in v0.18.0

func (mock *ClienterMock) PutTopicPrivate(ctx context.Context, reqHeaders sdk.Headers, id string, topicUpdate []byte) (*sdk.ResponseInfo, apiError.Error)

PutTopicPrivate calls PutTopicPrivateFunc.

func (*ClienterMock) PutTopicPrivateCalls added in v0.18.0

func (mock *ClienterMock) PutTopicPrivateCalls() []struct {
	Ctx         context.Context
	ReqHeaders  sdk.Headers
	ID          string
	TopicUpdate []byte
}

PutTopicPrivateCalls gets all the calls that were made to PutTopicPrivate. Check the length with:

len(mockedClienter.PutTopicPrivateCalls())

func (*ClienterMock) PutTopicReleasePrivate added in v0.14.0

func (mock *ClienterMock) PutTopicReleasePrivate(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, apiError.Error)

PutTopicReleasePrivate calls PutTopicReleasePrivateFunc.

func (*ClienterMock) PutTopicReleasePrivateCalls added in v0.14.0

func (mock *ClienterMock) PutTopicReleasePrivateCalls() []struct {
	Ctx          context.Context
	ReqHeaders   sdk.Headers
	ID           string
	TopicRelease []byte
}

PutTopicReleasePrivateCalls gets all the calls that were made to PutTopicReleasePrivate. Check the length with:

len(mockedClienter.PutTopicReleasePrivateCalls())

func (*ClienterMock) PutTopicStatePrivate added in v0.18.0

func (mock *ClienterMock) PutTopicStatePrivate(ctx context.Context, reqHeaders sdk.Headers, id string, topicState string) (*sdk.ResponseInfo, apiError.Error)

PutTopicStatePrivate calls PutTopicStatePrivateFunc.

func (*ClienterMock) PutTopicStatePrivateCalls added in v0.18.0

func (mock *ClienterMock) PutTopicStatePrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
	TopicState string
}

PutTopicStatePrivateCalls gets all the calls that were made to PutTopicStatePrivate. Check the length with:

len(mockedClienter.PutTopicStatePrivateCalls())

func (*ClienterMock) URL

func (mock *ClienterMock) URL() string

URL calls URLFunc.

func (*ClienterMock) URLCalls

func (mock *ClienterMock) URLCalls() []struct {
}

URLCalls gets all the calls that were made to URL. Check the length with:

len(mockedClienter.URLCalls())

Jump to

Keyboard shortcuts

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