{"modulePath":"github.com/newstack-cloud/bluelink/libs/plugin-framework","version":"v0.17.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testutils\n\n## Functions\n\n```go\nfunc AssertConfigDefinitionEquals(\n\texpected *core.ConfigDefinition,\n\tactual *core.ConfigDefinition,\n\ttestSuite *suite.Suite,\n)\n```\nAssertConfigDefinitionEquals asserts that two core config definitions are equal. This treats nil and empty slices in the config field definitions as equal.\n\n```go\nfunc AssertInvalidHost(\n\trespErr error,\n\taction errorsv1.PluginAction,\n\tinvalidHostID string,\n\ttestSuite *suite.Suite,\n)\n```\nAssertInvalidHost asserts that the given error is an invalid host error from a plugin method call response.\n\n```go\nfunc AssertLinkChangesEquals(\n\texpected *provider.LinkChanges,\n\tactual *provider.LinkChanges,\n\ttestSuite *suite.Suite,\n)\n```\nAssertLinkChangesEquals asserts that two provider link changes are equal. This treats nil and empty slices in the changes as equal.\n\n```go\nfunc AssertSlicesEqual[Item any](\n\texpected []Item,\n\tactual []Item,\n\ttestSuite *suite.Suite,\n)\n```\nAssertSlicesEqual asserts that two slices are equal. Nil and empty slices are considered equal. The order of the elements in the slices must be the same.\n\n```go\nfunc CreateEmptyConcreteParams() *core.ParamsImpl\n```\nCreateEmptyConcreteParams creates an empty set of concrete parameters for testing, primarily used for testing plugin functions.\n\n```go\nfunc CreateEmptyTestParams() core.BlueprintParams\n```\nCreateEmptyTestParams creates an empty set of parameters for testing, primarily used for testing plugin functions.\n\n```go\nfunc CreateTestLinkContext() provider.LinkContext\n```\nCreateTestLinkContext creates a link context for testing.\n\n```go\nfunc CreateTestProviderContext(namespace string) provider.Context\n```\nCreateTestProviderContext creates a provider context for testing with the given namespace.\n\n```go\nfunc CreateTestProviderContextWithTagging(\n\tnamespace string,\n\ttaggingConfig *provider.TaggingConfig,\n) provider.Context\n```\nCreateTestProviderContextWithTagging creates a provider context for testing with the given namespace and tagging configuration.\n\n```go\nfunc CreateTestTransformerContext(namespace string) transform.Context\n```\nCreateTestTransformerContext creates a transformer context for testing with the given namespace.\n\n```go\nfunc NewMemoryStateContainer() state.Container\n```\n\n```go\nfunc StartPluginServiceServer(\n\thostID string,\n\tpluginManager pluginservicev1.Manager,\n\tfunctionRegistry provider.FunctionRegistry,\n\tresourceService provider.ResourceService,\n) (pluginservicev1.ServiceClient, func())\n```\n\n```go\nfunc TestTaggingConfig() *provider.TaggingConfig\n```\nTestTaggingConfig returns a standard tagging configuration for testing.\n\n## Types\n\n```go\ntype FunctionCallArgsMock struct {\n\tArgs    []any\n\tCallCtx provider.FunctionCallContext\n}\n```\n\n```go\nfunc (f *FunctionCallArgsMock) Export(ctx context.Context) ([]any, error)\n```\n\n```go\nfunc (f *FunctionCallArgsMock) Get(ctx context.Context, position int) (any, error)\n```\n\n```go\nfunc (f *FunctionCallArgsMock) GetMultipleVars(ctx context.Context, targets ...any) error\n```\n\n```go\nfunc (f *FunctionCallArgsMock) GetVar(ctx context.Context, position int, target any) error\n```\n\n```go\ntype FunctionCallContextMock struct {\n\tCallCtxParams          *core.ParamsImpl\n\tCallCtxRegistry        provider.FunctionRegistry\n\tCallStack              function.Stack\n\tCallCtxCurrentLocation *source.Meta\n}\n```\n\n```go\nfunc (f *FunctionCallContextMock) CallStackSnapshot() []*function.Call\n```\n\n```go\nfunc (f *FunctionCallContextMock) CurrentLocation() *source.Meta\n```\n\n```go\nfunc (f *FunctionCallContextMock) NewCallArgs(args ...any) provider.FunctionCallArguments\n```\n\n```go\nfunc (f *FunctionCallContextMock) Params() core.BlueprintParams\n```\n\n```go\nfunc (f *FunctionCallContextMock) Registry() provider.FunctionRegistry\n```\n\n```go\ntype MemoryStateContainer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *MemoryStateContainer) Children() state.ChildrenContainer\n```\n\n```go\nfunc (c *MemoryStateContainer) Exports() state.ExportsContainer\n```\n\n```go\nfunc (c *MemoryStateContainer) Instances() state.InstancesContainer\n```\n\n```go\nfunc (c *MemoryStateContainer) Links() state.LinksContainer\n```\n\n```go\nfunc (c *MemoryStateContainer) Metadata() state.MetadataContainer\n```\n\n```go\nfunc (c *MemoryStateContainer) Resources() state.ResourcesContainer\n```\n\n```go\ntype MockProvider struct {\n\tProviderNamespace string\n}\n```\nMockProvider is a mock implementation of the \\`provider.Provider\\` interface for plugins in launch testing.\n\n```go\nfunc (m *MockProvider) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)\n```\n\n```go\nfunc (m *MockProvider) CustomVariableType(\n\tctx context.Context,\n\tcustomVariableType string,\n) (provider.CustomVariableType, error)\n```\n\n```go\nfunc (m *MockProvider) DataSource(\n\tctx context.Context,\n\tdataSourceType string,\n) (provider.DataSource, error)\n```\n\n```go\nfunc (m *MockProvider) Function(\n\tctx context.Context,\n\tfunctionName string,\n) (provider.Function, error)\n```\n\n```go\nfunc (m *MockProvider) Link(\n\tctx context.Context,\n\tresourceTypeA string,\n\tresourceTypeB string,\n) (provider.Link, error)\n```\n\n```go\nfunc (m *MockProvider) ListCustomVariableTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockProvider) ListDataSourceTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockProvider) ListFunctions(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockProvider) ListLinkTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockProvider) ListResourceTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockProvider) Namespace(ctx context.Context) (string, error)\n```\n\n```go\nfunc (m *MockProvider) Resource(\n\tctx context.Context,\n\tresourceType string,\n) (provider.Resource, error)\n```\n\n```go\nfunc (m *MockProvider) RetryPolicy(ctx context.Context) (*provider.RetryPolicy, error)\n```\n\n```go\ntype MockTransformer struct {\n\tTransformName string\n}\n```\nMockTransformer is a mock implementation of the \\`transform.SpecTransformer\\` interface for plugins in launch testing.\n\n```go\nfunc (m *MockTransformer) AbstractLink(\n\tctx context.Context,\n\tlinkType string,\n) (transform.AbstractLink, error)\n```\n\n```go\nfunc (m *MockTransformer) AbstractResource(\n\tctx context.Context,\n\tresourceType string,\n) (transform.AbstractResource, error)\n```\n\n```go\nfunc (m *MockTransformer) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)\n```\n\n```go\nfunc (m *MockTransformer) GetTransformName(ctx context.Context) (string, error)\n```\n\n```go\nfunc (m *MockTransformer) ListAbstractLinkTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockTransformer) ListAbstractResourceTypes(ctx context.Context) ([]string, error)\n```\n\n```go\nfunc (m *MockTransformer) Transform(\n\tctx context.Context,\n\tinputs *transform.SpecTransformerTransformInput,\n) (*transform.SpecTransformerTransformOutput, error)\n```\n\n```go\nfunc (m *MockTransformer) ValidateLinks(\n\tctx context.Context,\n\tinput *transform.SpecTransformerValidateLinksInput,\n) (*transform.SpecTransformerValidateLinksOutput, error)\n```\n\n","path":"github.com/newstack-cloud/bluelink/libs/plugin-framework/internal/testutils","name":"testutils","synopsis":"","isRedistributable":true}
