Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenIdentityMock ¶
type TokenIdentityMock struct { // CheckTokenIdentityFunc mocks the CheckTokenIdentity method. CheckTokenIdentityFunc func(ctx context.Context, token string, tokenType identity.TokenType) (*dprequest.IdentityResponse, error) // contains filtered or unexported fields }
TokenIdentityMock is a mock implementation of identity.TokenIdentity.
func TestSomethingThatUsesTokenIdentity(t *testing.T) { // make and configure a mocked identity.TokenIdentity mockedTokenIdentity := &TokenIdentityMock{ CheckTokenIdentityFunc: func(ctx context.Context, token string, tokenType identity.TokenType) (*dprequest.IdentityResponse, error) { panic("mock out the CheckTokenIdentity method") }, } // use mockedTokenIdentity in code that requires identity.TokenIdentity // and then make assertions. }
func (*TokenIdentityMock) CheckTokenIdentity ¶
func (mock *TokenIdentityMock) CheckTokenIdentity(ctx context.Context, token string, tokenType identity.TokenType) (*dprequest.IdentityResponse, error)
CheckTokenIdentity calls CheckTokenIdentityFunc.
func (*TokenIdentityMock) CheckTokenIdentityCalls ¶
func (mock *TokenIdentityMock) CheckTokenIdentityCalls() []struct { Ctx context.Context Token string TokenType identity.TokenType }
CheckTokenIdentityCalls gets all the calls that were made to CheckTokenIdentity. Check the length with:
len(mockedTokenIdentity.CheckTokenIdentityCalls())
Click to show internal directories.
Click to hide internal directories.