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