Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VerifierMock ¶
type VerifierMock struct {
// VerifyFunc mocks the Verify method.
VerifyFunc func(ctx context.Context, token string) (*auth.Principal, error)
// contains filtered or unexported fields
}
VerifierMock is a mock implementation of auth.Verifier.
func TestSomethingThatUsesVerifier(t *testing.T) {
// make and configure a mocked auth.Verifier
mockedVerifier := &VerifierMock{
VerifyFunc: func(ctx context.Context, token string) (*auth.Principal, error) {
panic("mock out the Verify method")
},
}
// use mockedVerifier in code that requires auth.Verifier
// and then make assertions.
}
func (*VerifierMock) VerifyCalls ¶
func (mock *VerifierMock) VerifyCalls() []struct { Ctx context.Context Token string }
VerifyCalls gets all the calls that were made to Verify. Check the length with:
len(mockedVerifier.VerifyCalls())
Click to show internal directories.
Click to hide internal directories.