...
AWS SDK for Go API Reference
import "github.com/aws/aws-sdk-go/service/migrationhubrefactorspaces/migrationhubrefactorspacesiface"
Overview
Index

Overview ▾

Package migrationhubrefactorspacesiface provides an interface to enable mocking the AWS Migration Hub Refactor Spaces service client for testing your code.

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.

type MigrationHubRefactorSpacesAPI

type MigrationHubRefactorSpacesAPI interface {
    CreateApplication(*migrationhubrefactorspaces.CreateApplicationInput) (*migrationhubrefactorspaces.CreateApplicationOutput, error)
    CreateApplicationWithContext(aws.Context, *migrationhubrefactorspaces.CreateApplicationInput, ...request.Option) (*migrationhubrefactorspaces.CreateApplicationOutput, error)
    CreateApplicationRequest(*migrationhubrefactorspaces.CreateApplicationInput) (*request.Request, *migrationhubrefactorspaces.CreateApplicationOutput)

    CreateEnvironment(*migrationhubrefactorspaces.CreateEnvironmentInput) (*migrationhubrefactorspaces.CreateEnvironmentOutput, error)
    CreateEnvironmentWithContext(aws.Context, *migrationhubrefactorspaces.CreateEnvironmentInput, ...request.Option) (*migrationhubrefactorspaces.CreateEnvironmentOutput, error)
    CreateEnvironmentRequest(*migrationhubrefactorspaces.CreateEnvironmentInput) (*request.Request, *migrationhubrefactorspaces.CreateEnvironmentOutput)

    CreateRoute(*migrationhubrefactorspaces.CreateRouteInput) (*migrationhubrefactorspaces.CreateRouteOutput, error)
    CreateRouteWithContext(aws.Context, *migrationhubrefactorspaces.CreateRouteInput, ...request.Option) (*migrationhubrefactorspaces.CreateRouteOutput, error)
    CreateRouteRequest(*migrationhubrefactorspaces.CreateRouteInput) (*request.Request, *migrationhubrefactorspaces.CreateRouteOutput)

    CreateService(*migrationhubrefactorspaces.CreateServiceInput) (*migrationhubrefactorspaces.CreateServiceOutput, error)
    CreateServiceWithContext(aws.Context, *migrationhubrefactorspaces.CreateServiceInput, ...request.Option) (*migrationhubrefactorspaces.CreateServiceOutput, error)
    CreateServiceRequest(*migrationhubrefactorspaces.CreateServiceInput) (*request.Request, *migrationhubrefactorspaces.CreateServiceOutput)

    DeleteApplication(*migrationhubrefactorspaces.DeleteApplicationInput) (*migrationhubrefactorspaces.DeleteApplicationOutput, error)
    DeleteApplicationWithContext(aws.Context, *migrationhubrefactorspaces.DeleteApplicationInput, ...request.Option) (*migrationhubrefactorspaces.DeleteApplicationOutput, error)
    DeleteApplicationRequest(*migrationhubrefactorspaces.DeleteApplicationInput) (*request.Request, *migrationhubrefactorspaces.DeleteApplicationOutput)

    DeleteEnvironment(*migrationhubrefactorspaces.DeleteEnvironmentInput) (*migrationhubrefactorspaces.DeleteEnvironmentOutput, error)
    DeleteEnvironmentWithContext(aws.Context, *migrationhubrefactorspaces.DeleteEnvironmentInput, ...request.Option) (*migrationhubrefactorspaces.DeleteEnvironmentOutput, error)
    DeleteEnvironmentRequest(*migrationhubrefactorspaces.DeleteEnvironmentInput) (*request.Request, *migrationhubrefactorspaces.DeleteEnvironmentOutput)

    DeleteResourcePolicy(*migrationhubrefactorspaces.DeleteResourcePolicyInput) (*migrationhubrefactorspaces.DeleteResourcePolicyOutput, error)
    DeleteResourcePolicyWithContext(aws.Context, *migrationhubrefactorspaces.DeleteResourcePolicyInput, ...request.Option) (*migrationhubrefactorspaces.DeleteResourcePolicyOutput, error)
    DeleteResourcePolicyRequest(*migrationhubrefactorspaces.DeleteResourcePolicyInput) (*request.Request, *migrationhubrefactorspaces.DeleteResourcePolicyOutput)

    DeleteRoute(*migrationhubrefactorspaces.DeleteRouteInput) (*migrationhubrefactorspaces.DeleteRouteOutput, error)
    DeleteRouteWithContext(aws.Context, *migrationhubrefactorspaces.DeleteRouteInput, ...request.Option) (*migrationhubrefactorspaces.DeleteRouteOutput, error)
    DeleteRouteRequest(*migrationhubrefactorspaces.DeleteRouteInput) (*request.Request, *migrationhubrefactorspaces.DeleteRouteOutput)

    DeleteService(*migrationhubrefactorspaces.DeleteServiceInput) (*migrationhubrefactorspaces.DeleteServiceOutput, error)
    DeleteServiceWithContext(aws.Context, *migrationhubrefactorspaces.DeleteServiceInput, ...request.Option) (*migrationhubrefactorspaces.DeleteServiceOutput, error)
    DeleteServiceRequest(*migrationhubrefactorspaces.DeleteServiceInput) (*request.Request, *migrationhubrefactorspaces.DeleteServiceOutput)

    GetApplication(*migrationhubrefactorspaces.GetApplicationInput) (*migrationhubrefactorspaces.GetApplicationOutput, error)
    GetApplicationWithContext(aws.Context, *migrationhubrefactorspaces.GetApplicationInput, ...request.Option) (*migrationhubrefactorspaces.GetApplicationOutput, error)
    GetApplicationRequest(*migrationhubrefactorspaces.GetApplicationInput) (*request.Request, *migrationhubrefactorspaces.GetApplicationOutput)

    GetEnvironment(*migrationhubrefactorspaces.GetEnvironmentInput) (*migrationhubrefactorspaces.GetEnvironmentOutput, error)
    GetEnvironmentWithContext(aws.Context, *migrationhubrefactorspaces.GetEnvironmentInput, ...request.Option) (*migrationhubrefactorspaces.GetEnvironmentOutput, error)
    GetEnvironmentRequest(*migrationhubrefactorspaces.GetEnvironmentInput) (*request.Request, *migrationhubrefactorspaces.GetEnvironmentOutput)

    GetResourcePolicy(*migrationhubrefactorspaces.GetResourcePolicyInput) (*migrationhubrefactorspaces.GetResourcePolicyOutput, error)
    GetResourcePolicyWithContext(aws.Context, *migrationhubrefactorspaces.GetResourcePolicyInput, ...request.Option) (*migrationhubrefactorspaces.GetResourcePolicyOutput, error)
    GetResourcePolicyRequest(*migrationhubrefactorspaces.GetResourcePolicyInput) (*request.Request, *migrationhubrefactorspaces.GetResourcePolicyOutput)

    GetRoute(*migrationhubrefactorspaces.GetRouteInput) (*migrationhubrefactorspaces.GetRouteOutput, error)
    GetRouteWithContext(aws.Context, *migrationhubrefactorspaces.GetRouteInput, ...request.Option) (*migrationhubrefactorspaces.GetRouteOutput, error)
    GetRouteRequest(*migrationhubrefactorspaces.GetRouteInput) (*request.Request, *migrationhubrefactorspaces.GetRouteOutput)

    GetService(*migrationhubrefactorspaces.GetServiceInput) (*migrationhubrefactorspaces.GetServiceOutput, error)
    GetServiceWithContext(aws.Context, *migrationhubrefactorspaces.GetServiceInput, ...request.Option) (*migrationhubrefactorspaces.GetServiceOutput, error)
    GetServiceRequest(*migrationhubrefactorspaces.GetServiceInput) (*request.Request, *migrationhubrefactorspaces.GetServiceOutput)

    ListApplications(*migrationhubrefactorspaces.ListApplicationsInput) (*migrationhubrefactorspaces.ListApplicationsOutput, error)
    ListApplicationsWithContext(aws.Context, *migrationhubrefactorspaces.ListApplicationsInput, ...request.Option) (*migrationhubrefactorspaces.ListApplicationsOutput, error)
    ListApplicationsRequest(*migrationhubrefactorspaces.ListApplicationsInput) (*request.Request, *migrationhubrefactorspaces.ListApplicationsOutput)

    ListApplicationsPages(*migrationhubrefactorspaces.ListApplicationsInput, func(*migrationhubrefactorspaces.ListApplicationsOutput, bool) bool) error
    ListApplicationsPagesWithContext(aws.Context, *migrationhubrefactorspaces.ListApplicationsInput, func(*migrationhubrefactorspaces.ListApplicationsOutput, bool) bool, ...request.Option) error

    ListEnvironmentVpcs(*migrationhubrefactorspaces.ListEnvironmentVpcsInput) (*migrationhubrefactorspaces.ListEnvironmentVpcsOutput, error)
    ListEnvironmentVpcsWithContext(aws.Context, *migrationhubrefactorspaces.ListEnvironmentVpcsInput, ...request.Option) (*migrationhubrefactorspaces.ListEnvironmentVpcsOutput, error)
    ListEnvironmentVpcsRequest(*migrationhubrefactorspaces.ListEnvironmentVpcsInput) (*request.Request, *migrationhubrefactorspaces.ListEnvironmentVpcsOutput)

    ListEnvironmentVpcsPages(*migrationhubrefactorspaces.ListEnvironmentVpcsInput, func(*migrationhubrefactorspaces.ListEnvironmentVpcsOutput, bool) bool) error
    ListEnvironmentVpcsPagesWithContext(aws.Context, *migrationhubrefactorspaces.ListEnvironmentVpcsInput, func(*migrationhubrefactorspaces.ListEnvironmentVpcsOutput, bool) bool, ...request.Option) error

    ListEnvironments(*migrationhubrefactorspaces.ListEnvironmentsInput) (*migrationhubrefactorspaces.ListEnvironmentsOutput, error)
    ListEnvironmentsWithContext(aws.Context, *migrationhubrefactorspaces.ListEnvironmentsInput, ...request.Option) (*migrationhubrefactorspaces.ListEnvironmentsOutput, error)
    ListEnvironmentsRequest(*migrationhubrefactorspaces.ListEnvironmentsInput) (*request.Request, *migrationhubrefactorspaces.ListEnvironmentsOutput)

    ListEnvironmentsPages(*migrationhubrefactorspaces.ListEnvironmentsInput, func(*migrationhubrefactorspaces.ListEnvironmentsOutput, bool) bool) error
    ListEnvironmentsPagesWithContext(aws.Context, *migrationhubrefactorspaces.ListEnvironmentsInput, func(*migrationhubrefactorspaces.ListEnvironmentsOutput, bool) bool, ...request.Option) error

    ListRoutes(*migrationhubrefactorspaces.ListRoutesInput) (*migrationhubrefactorspaces.ListRoutesOutput, error)
    ListRoutesWithContext(aws.Context, *migrationhubrefactorspaces.ListRoutesInput, ...request.Option) (*migrationhubrefactorspaces.ListRoutesOutput, error)
    ListRoutesRequest(*migrationhubrefactorspaces.ListRoutesInput) (*request.Request, *migrationhubrefactorspaces.ListRoutesOutput)

    ListRoutesPages(*migrationhubrefactorspaces.ListRoutesInput, func(*migrationhubrefactorspaces.ListRoutesOutput, bool) bool) error
    ListRoutesPagesWithContext(aws.Context, *migrationhubrefactorspaces.ListRoutesInput, func(*migrationhubrefactorspaces.ListRoutesOutput, bool) bool, ...request.Option) error

    ListServices(*migrationhubrefactorspaces.ListServicesInput) (*migrationhubrefactorspaces.ListServicesOutput, error)
    ListServicesWithContext(aws.Context, *migrationhubrefactorspaces.ListServicesInput, ...request.Option) (*migrationhubrefactorspaces.ListServicesOutput, error)
    ListServicesRequest(*migrationhubrefactorspaces.ListServicesInput) (*request.Request, *migrationhubrefactorspaces.ListServicesOutput)

    ListServicesPages(*migrationhubrefactorspaces.ListServicesInput, func(*migrationhubrefactorspaces.ListServicesOutput, bool) bool) error
    ListServicesPagesWithContext(aws.Context, *migrationhubrefactorspaces.ListServicesInput, func(*migrationhubrefactorspaces.ListServicesOutput, bool) bool, ...request.Option) error

    ListTagsForResource(*migrationhubrefactorspaces.ListTagsForResourceInput) (*migrationhubrefactorspaces.ListTagsForResourceOutput, error)
    ListTagsForResourceWithContext(aws.Context, *migrationhubrefactorspaces.ListTagsForResourceInput, ...request.Option) (*migrationhubrefactorspaces.ListTagsForResourceOutput, error)
    ListTagsForResourceRequest(*migrationhubrefactorspaces.ListTagsForResourceInput) (*request.Request, *migrationhubrefactorspaces.ListTagsForResourceOutput)

    PutResourcePolicy(*migrationhubrefactorspaces.PutResourcePolicyInput) (*migrationhubrefactorspaces.PutResourcePolicyOutput, error)
    PutResourcePolicyWithContext(aws.Context, *migrationhubrefactorspaces.PutResourcePolicyInput, ...request.Option) (*migrationhubrefactorspaces.PutResourcePolicyOutput, error)
    PutResourcePolicyRequest(*migrationhubrefactorspaces.PutResourcePolicyInput) (*request.Request, *migrationhubrefactorspaces.PutResourcePolicyOutput)

    TagResource(*migrationhubrefactorspaces.TagResourceInput) (*migrationhubrefactorspaces.TagResourceOutput, error)
    TagResourceWithContext(aws.Context, *migrationhubrefactorspaces.TagResourceInput, ...request.Option) (*migrationhubrefactorspaces.TagResourceOutput, error)
    TagResourceRequest(*migrationhubrefactorspaces.TagResourceInput) (*request.Request, *migrationhubrefactorspaces.TagResourceOutput)

    UntagResource(*migrationhubrefactorspaces.UntagResourceInput) (*migrationhubrefactorspaces.UntagResourceOutput, error)
    UntagResourceWithContext(aws.Context, *migrationhubrefactorspaces.UntagResourceInput, ...request.Option) (*migrationhubrefactorspaces.UntagResourceOutput, error)
    UntagResourceRequest(*migrationhubrefactorspaces.UntagResourceInput) (*request.Request, *migrationhubrefactorspaces.UntagResourceOutput)

    UpdateRoute(*migrationhubrefactorspaces.UpdateRouteInput) (*migrationhubrefactorspaces.UpdateRouteOutput, error)
    UpdateRouteWithContext(aws.Context, *migrationhubrefactorspaces.UpdateRouteInput, ...request.Option) (*migrationhubrefactorspaces.UpdateRouteOutput, error)
    UpdateRouteRequest(*migrationhubrefactorspaces.UpdateRouteInput) (*request.Request, *migrationhubrefactorspaces.UpdateRouteOutput)
}

MigrationHubRefactorSpacesAPI provides an interface to enable mocking the migrationhubrefactorspaces.MigrationHubRefactorSpaces service client's API operation, paginators, and waiters. This make unit testing your code that calls out to the SDK's service client's calls easier.

The best way to use this interface is so the SDK's service client's calls can be stubbed out for unit testing your code with the SDK without needing to inject custom request handlers into the SDK's request pipeline.

// myFunc uses an SDK service client to make a request to
// AWS Migration Hub Refactor Spaces.
func myFunc(svc migrationhubrefactorspacesiface.MigrationHubRefactorSpacesAPI) bool {
    // Make svc.CreateApplication request
}

func main() {
    sess := session.New()
    svc := migrationhubrefactorspaces.New(sess)

    myFunc(svc)
}

In your _test.go file:

// Define a mock struct to be used in your unit tests of myFunc.
type mockMigrationHubRefactorSpacesClient struct {
    migrationhubrefactorspacesiface.MigrationHubRefactorSpacesAPI
}
func (m *mockMigrationHubRefactorSpacesClient) CreateApplication(input *migrationhubrefactorspaces.CreateApplicationInput) (*migrationhubrefactorspaces.CreateApplicationOutput, error) {
    // mock response/functionality
}

func TestMyFunc(t *testing.T) {
    // Setup Test
    mockSvc := &mockMigrationHubRefactorSpacesClient{}

    myfunc(mockSvc)

    // Verify myFunc's functionality
}

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters. Its suggested to use the pattern above for testing, or using tooling to generate mocks to satisfy the interfaces.