testutils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockEnvironmentsClient

type MockEnvironmentsClient struct {
	mock.Mock
}

MockEnvironmentsClient is a mock implementation of the EnvironmentsClient interface. It provides test doubles for all environments API operations and uses testify/mock for flexible test assertions and behavior configuration.

func (*MockEnvironmentsClient) CreateEnvironment

CreateEnvironment creates a new PingOne environment with the provided configuration. Returns the created environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The request parameter contains the environment configuration including name, type, and license.

func (*MockEnvironmentsClient) GetEnvironment

func (m *MockEnvironmentsClient) GetEnvironment(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentResponse, *http.Response, error)

GetEnvironment retrieves a specific environment by its unique identifier. Returns the environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment to retrieve.

func (*MockEnvironmentsClient) GetEnvironmentServices

func (m *MockEnvironmentsClient) GetEnvironmentServices(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentBillOfMaterialsResponse, *http.Response, error)

GetEnvironmentServices retrieves the bill of materials (enabled services) for an environment. Returns the bill of materials response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment whose services to retrieve.

func (*MockEnvironmentsClient) GetEnvironments

GetEnvironments retrieves a paginated list of environments matching the optional filter. Returns a PagedIterator for accessing environment collection responses and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The filter parameter specifies optional filter criteria to limit the environments returned.

func (*MockEnvironmentsClient) UpdateEnvironment

UpdateEnvironment updates an existing environment with new configuration. Returns the updated environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment to update. The request parameter contains the updated environment configuration.

func (*MockEnvironmentsClient) UpdateEnvironmentServices

UpdateEnvironmentServices updates the enabled services (bill of materials) for an environment. Returns the updated bill of materials response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment whose services to update. The request parameter contains the updated bill of materials configuration.

type MockEnvironmentsClientFactory

type MockEnvironmentsClientFactory struct {
	Client environments.EnvironmentsClient
	Err    error
}

MockEnvironmentsClientFactory is a mock implementation of the EnvironmentsClientFactory interface. It returns a pre-configured mock client and optional error for testing authentication flows.

func NewMockEnvironmentsClientFactory

func NewMockEnvironmentsClientFactory(client environments.EnvironmentsClient, err error) *MockEnvironmentsClientFactory

NewMockEnvironmentsClientFactory creates a new MockEnvironmentsClientFactory with the provided client and error. The client parameter is the mock client instance to return from GetAuthenticatedClient. The err parameter is the error to return from GetAuthenticatedClient, or nil for successful authentication.

func (*MockEnvironmentsClientFactory) GetAuthenticatedClient

GetAuthenticatedClient returns the pre-configured mock client and error. This method implements the EnvironmentsClientFactory interface for testing purposes. The ctx parameter provides context for the authentication operation (not used in mock).

Jump to

Keyboard shortcuts

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