testutils

package
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInstanceRequest

func CreateInstanceRequest(ctx context.Context, schema resource.SchemaResponse, model instance.Model) resource.CreateRequest

func CreateInstanceTestModel

func CreateInstanceTestModel(projectId, region, name, description string) instance.Model

func CreateInstanceTokenRequest

func CreateInstanceTokenRequest(ctx context.Context, schema resource.SchemaResponse, model token.Model) resource.CreateRequest

func CreateResponse

func CreateResponse(schema resource.SchemaResponse) *resource.CreateResponse

func DeleteInstanceRequest

func DeleteInstanceRequest(ctx context.Context, schema resource.SchemaResponse, state instance.Model) resource.DeleteRequest

DeleteInstanceRequest creates a test Delete request

func DeleteInstanceResponse

func DeleteInstanceResponse(ctx context.Context, schema resource.SchemaResponse, currentState *instance.Model) *resource.DeleteResponse

DeleteInstanceResponse creates a test Delete response Optionally initialize with current state to simulate Terraform framework behavior

func DeleteTokenRequest

func DeleteTokenRequest(ctx context.Context, schema resource.SchemaResponse, state token.Model) resource.DeleteRequest

func DeleteTokenResponse

func DeleteTokenResponse(ctx context.Context, schema resource.SchemaResponse, currentState *token.Model) *resource.DeleteResponse

func ReadInstanceRequest

func ReadInstanceRequest(ctx context.Context, schema resource.SchemaResponse, state instance.Model) resource.ReadRequest

ReadInstanceRequest creates a test Read request

func ReadInstanceResponse

func ReadInstanceResponse(ctx context.Context, schema resource.SchemaResponse, currentState *instance.Model) *resource.ReadResponse

ReadInstanceResponse creates a test Read response

func ReadTokenRequest

func ReadTokenRequest(ctx context.Context, schema resource.SchemaResponse, state token.Model) resource.ReadRequest

func ReadTokenResponse

func ReadTokenResponse(ctx context.Context, schema resource.SchemaResponse, currentState *token.Model) *resource.ReadResponse

func UpdateInstanceRequest

func UpdateInstanceRequest(ctx context.Context, schema resource.SchemaResponse, currentState, plannedState instance.Model) resource.UpdateRequest

func UpdateInstanceResponse

func UpdateInstanceResponse(ctx context.Context, schema resource.SchemaResponse, currentState *instance.Model) *resource.UpdateResponse

UpdateInstanceResponse creates a test Update response Optionally initialize with current state to simulate Terraform framework behavior

func UpdateTokenRequest

func UpdateTokenRequest(ctx context.Context, schema resource.SchemaResponse, currentState, plannedState token.Model) resource.UpdateRequest

func UpdateTokenResponse

func UpdateTokenResponse(ctx context.Context, schema resource.SchemaResponse, currentState *token.Model) *resource.UpdateResponse

Types

type TestContext

type TestContext struct {
	T                           *testing.T
	MockCtrl                    *gomock.Controller
	MockInstanceCLient          *mock_instance.MockDefaultAPI
	MockServiceEnablementClient *mock_serviceenablement.MockDefaultAPI
	Ctx                         context.Context
}

func NewTestContext

func NewTestContext(t *testing.T) *TestContext

Jump to

Keyboard shortcuts

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