update mock provider call
This commit is contained in:
parent
027a6c2cf6
commit
103a6cf2db
|
@ -79,12 +79,13 @@ func TestLocal_refreshInput(t *testing.T) {
|
||||||
p.ReadResourceResponse = providers.ReadResourceResponse{NewState: cty.ObjectVal(map[string]cty.Value{
|
p.ReadResourceResponse = providers.ReadResourceResponse{NewState: cty.ObjectVal(map[string]cty.Value{
|
||||||
"id": cty.StringVal("yes"),
|
"id": cty.StringVal("yes"),
|
||||||
})}
|
})}
|
||||||
p.ConfigureFn = func(c *terraform.ResourceConfig) error {
|
p.ConfigureFn = func(req providers.ConfigureRequest) (resp providers.ConfigureResponse) {
|
||||||
if v, ok := c.Get("value"); !ok || v != "bar" {
|
val := req.Config.GetAttr("value")
|
||||||
return fmt.Errorf("no value set")
|
if val.IsNull() || val.AsString() != "bar" {
|
||||||
|
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("incorrect value %#v", val))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable input asking since it is normally disabled by default
|
// Enable input asking since it is normally disabled by default
|
||||||
|
|
Loading…
Reference in New Issue