]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/terraform/resource_provisioner_mock.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / resource_provisioner_mock.go
index f471a5182bfe700e8f3806f6aa181dc2618bf653..7b88cf733391950f4ee3732da001d94a6bf1b46f 100644 (file)
@@ -1,6 +1,10 @@
 package terraform
 
-import "sync"
+import (
+       "sync"
+
+       "github.com/hashicorp/terraform/configs/configschema"
+)
 
 // MockResourceProvisioner implements ResourceProvisioner but mocks out all the
 // calls for testing purposes.
@@ -9,6 +13,10 @@ type MockResourceProvisioner struct {
        // 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
@@ -27,6 +35,13 @@ type MockResourceProvisioner struct {
        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()