Documentation
¶
Index ¶
- func LegacyHandler(ctx context.Context, zc ZebedeeClient) http.HandlerFunc
- type API
- type ZebedeeClient
- type ZebedeeClientMock
- func (mock *ZebedeeClientMock) Checker(ctx context.Context, check *healthcheck.CheckState) error
- func (mock *ZebedeeClientMock) CheckerCalls() []struct{ ... }
- func (mock *ZebedeeClientMock) GetRelease(ctx context.Context, userAccessToken string, collectionID string, lang string, ...) (zebedee.Release, error)
- func (mock *ZebedeeClientMock) GetReleaseCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LegacyHandler ¶
func LegacyHandler(ctx context.Context, zc ZebedeeClient) http.HandlerFunc
Types ¶
type ZebedeeClient ¶
type ZebedeeClient interface {
GetRelease(ctx context.Context, userAccessToken, collectionID, lang, uri string) (zebedee.Release, error)
Checker(ctx context.Context, check *healthcheck.CheckState) error
}
ZebedeeClient defines the required methods to talk to Zebedee
type ZebedeeClientMock ¶
type ZebedeeClientMock struct {
// CheckerFunc mocks the Checker method.
CheckerFunc func(ctx context.Context, check *healthcheck.CheckState) error
// GetReleaseFunc mocks the GetRelease method.
GetReleaseFunc func(ctx context.Context, userAccessToken string, collectionID string, lang string, uri string) (zebedee.Release, error)
// contains filtered or unexported fields
}
ZebedeeClientMock is a mock implementation of ZebedeeClient.
func TestSomethingThatUsesZebedeeClient(t *testing.T) {
// make and configure a mocked ZebedeeClient
mockedZebedeeClient := &ZebedeeClientMock{
CheckerFunc: func(ctx context.Context, check *healthcheck.CheckState) error {
panic("mock out the Checker method")
},
GetReleaseFunc: func(ctx context.Context, userAccessToken string, collectionID string, lang string, uri string) (zebedee.Release, error) {
panic("mock out the GetRelease method")
},
}
// use mockedZebedeeClient in code that requires ZebedeeClient
// and then make assertions.
}
func (*ZebedeeClientMock) Checker ¶
func (mock *ZebedeeClientMock) Checker(ctx context.Context, check *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*ZebedeeClientMock) CheckerCalls ¶
func (mock *ZebedeeClientMock) CheckerCalls() []struct { Ctx context.Context Check *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedZebedeeClient.CheckerCalls())
func (*ZebedeeClientMock) GetRelease ¶
func (mock *ZebedeeClientMock) GetRelease(ctx context.Context, userAccessToken string, collectionID string, lang string, uri string) (zebedee.Release, error)
GetRelease calls GetReleaseFunc.
func (*ZebedeeClientMock) GetReleaseCalls ¶
func (mock *ZebedeeClientMock) GetReleaseCalls() []struct { Ctx context.Context UserAccessToken string CollectionID string Lang string URI string }
GetReleaseCalls gets all the calls that were made to GetRelease. Check the length with:
len(mockedZebedeeClient.GetReleaseCalls())
Click to show internal directories.
Click to hide internal directories.