mock

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentityInterfaceMock

type IdentityInterfaceMock struct {
	// GetFunc mocks the Get method.
	GetFunc func(ctx context.Context, url string) (*http.Response, error)
	// contains filtered or unexported fields
}

IdentityInterfaceMock is a mock implementation of identityclient.IdentityInterface.

func TestSomethingThatUsesIdentityInterface(t *testing.T) {

	// make and configure a mocked identityclient.IdentityInterface
	mockedIdentityInterface := &IdentityInterfaceMock{
		GetFunc: func(ctx context.Context, url string) (*http.Response, error) {
			panic("mock out the Get method")
		},
	}

	// use mockedIdentityInterface in code that requires identityclient.IdentityInterface
	// and then make assertions.

}

func (*IdentityInterfaceMock) Get

func (mock *IdentityInterfaceMock) Get(ctx context.Context, url string) (*http.Response, error)

Get calls GetFunc.

func (*IdentityInterfaceMock) GetCalls

func (mock *IdentityInterfaceMock) GetCalls() []struct {
	Ctx context.Context
	URL string
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedIdentityInterface.GetCalls())

Jump to

Keyboard shortcuts

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