Add TestReset to terraformMockResourceProvider
Have MockResourceProvider implement TestProvider to check that TestReset is called by the test harness.
This commit is contained in:
parent
1eb9a2d083
commit
0279d11c8a
|
@ -56,6 +56,8 @@ type MockResourceProvider struct {
|
|||
ReadDataDiffFn func(*InstanceInfo, *ResourceConfig) (*InstanceDiff, error)
|
||||
ReadDataDiffReturn *InstanceDiff
|
||||
ReadDataDiffReturnError error
|
||||
TestResetCalled bool
|
||||
TestResetError error
|
||||
StopCalled bool
|
||||
StopFn func() error
|
||||
StopReturnError error
|
||||
|
@ -144,6 +146,14 @@ func (p *MockResourceProvider) Configure(c *ResourceConfig) error {
|
|||
return p.ConfigureReturnError
|
||||
}
|
||||
|
||||
func (p *MockResourceProvider) TestReset() error {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
|
||||
p.TestResetCalled = true
|
||||
return p.TestResetError
|
||||
}
|
||||
|
||||
func (p *MockResourceProvider) Stop() error {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
|
|
Loading…
Reference in New Issue