mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 08:51:02 -06:00
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
|
||||
|
||||
import "sync"
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/terraform/config/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()
|
||||
|
Loading…
Reference in New Issue
Block a user