opentofu/internal/terraform/provisioner_mock_test.go
Martin Atkins 36d0a50427 Move terraform/ to internal/terraform/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00

28 lines
1.1 KiB
Go

package terraform
import (
"github.com/hashicorp/terraform/internal/provisioners"
)
// simpleMockProvisioner returns a MockProvisioner that is pre-configured
// with schema for its own config, with the same content as returned by
// function simpleTestSchema.
//
// For most reasonable uses the returned provisioner must be registered in a
// componentFactory under the name "test". Use simpleMockComponentFactory
// to obtain a pre-configured componentFactory containing the result of
// this function along with simpleMockProvider, both registered as "test".
//
// The returned provisioner has no other behaviors by default, but the caller
// may modify it in order to stub any other required functionality, or modify
// the default schema stored in the field GetSchemaReturn. Each new call to
// simpleTestProvisioner produces entirely new instances of all of the nested
// objects so that callers can mutate without affecting mock objects.
func simpleMockProvisioner() *MockProvisioner {
return &MockProvisioner{
GetSchemaResponse: provisioners.GetSchemaResponse{
Provisioner: simpleTestSchema(),
},
}
}