package terraform
-import "sync"
+import (
+ "sync"
+
+ "github.com/hashicorp/terraform/configs/configschema"
+)
// MockResourceProvisioner implements ResourceProvisioner but mocks out all the
// calls for testing purposes.
// Anything you want, in case you need to store extra data with the mock.
Meta interface{}
+ GetConfigSchemaCalled bool
+ GetConfigSchemaReturnSchema *configschema.Block
+ GetConfigSchemaReturnError error
+
ApplyCalled bool
ApplyOutput UIOutput
ApplyState *InstanceState
StopReturnError error
}
+var _ ResourceProvisioner = (*MockResourceProvisioner)(nil)
+
+func (p *MockResourceProvisioner) GetConfigSchema() (*configschema.Block, error) {
+ p.GetConfigSchemaCalled = true
+ return p.GetConfigSchemaReturnSchema, p.GetConfigSchemaReturnError
+}
+
func (p *MockResourceProvisioner) Validate(c *ResourceConfig) ([]string, []error) {
p.Lock()
defer p.Unlock()