github.com/hashicorp/terraform-plugin-sdk@v1.17.2/terraform/resource_provisioner_mock_test.go (about)

     1  package terraform
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/terraform-plugin-sdk/internal/provisioners"
     7  )
     8  
     9  func TestMockResourceProvisioner_impl(t *testing.T) {
    10  	var _ ResourceProvisioner = new(MockResourceProvisioner)
    11  }
    12  
    13  // simpleMockProvisioner returns a MockProvisioner that is pre-configured
    14  // with schema for its own config, with the same content as returned by
    15  // function simpleTestSchema.
    16  //
    17  // For most reasonable uses the returned provisioner must be registered in a
    18  // componentFactory under the name "test". Use simpleMockComponentFactory
    19  // to obtain a pre-configured componentFactory containing the result of
    20  // this function along with simpleMockProvider, both registered as "test".
    21  //
    22  // The returned provisioner has no other behaviors by default, but the caller
    23  // may modify it in order to stub any other required functionality, or modify
    24  // the default schema stored in the field GetSchemaReturn. Each new call to
    25  // simpleTestProvisioner produces entirely new instances of all of the nested
    26  // objects so that callers can mutate without affecting mock objects.
    27  func simpleMockProvisioner() *MockProvisioner {
    28  	return &MockProvisioner{
    29  		GetSchemaResponse: provisioners.GetSchemaResponse{
    30  			Provisioner: simpleTestSchema(),
    31  		},
    32  	}
    33  }