core: Update MockResourceProvisioner to include GetConfigSchema
This method is now required for the ResourceProvisioner interface.
This commit is contained in:
parent
f085af4ba6
commit
20f6de735d
|
@ -1,6 +1,10 @@
|
||||||
package terraform
|
package terraform
|
||||||
|
|
||||||
import "sync"
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/config/configschema"
|
||||||
|
)
|
||||||
|
|
||||||
// MockResourceProvisioner implements ResourceProvisioner but mocks out all the
|
// MockResourceProvisioner implements ResourceProvisioner but mocks out all the
|
||||||
// calls for testing purposes.
|
// 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.
|
// Anything you want, in case you need to store extra data with the mock.
|
||||||
Meta interface{}
|
Meta interface{}
|
||||||
|
|
||||||
|
GetConfigSchemaCalled bool
|
||||||
|
GetConfigSchemaReturnSchema *configschema.Block
|
||||||
|
GetConfigSchemaReturnError error
|
||||||
|
|
||||||
ApplyCalled bool
|
ApplyCalled bool
|
||||||
ApplyOutput UIOutput
|
ApplyOutput UIOutput
|
||||||
ApplyState *InstanceState
|
ApplyState *InstanceState
|
||||||
|
@ -27,6 +35,13 @@ type MockResourceProvisioner struct {
|
||||||
StopReturnError error
|
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) {
|
func (p *MockResourceProvisioner) Validate(c *ResourceConfig) ([]string, []error) {
|
||||||
p.Lock()
|
p.Lock()
|
||||||
defer p.Unlock()
|
defer p.Unlock()
|
||||||
|
|
Loading…
Reference in New Issue