diff --git a/terraform/context_plan_test.go b/terraform/context_plan_test.go index 323caa20c..cf2c3e021 100644 --- a/terraform/context_plan_test.go +++ b/terraform/context_plan_test.go @@ -5789,7 +5789,7 @@ resource "aws_instance" "foo" { Status: states.ObjectReady, AttrsJSON: []byte(`{"id":"child"}`), }, - mustProviderConfig(`provider["registry.terraform.io/-/aws"]`), + mustProviderConfig(`provider["registry.terraform.io/hashicorp/aws"]`), ) state.EnsureModule(addrs.RootModuleInstance.Child("mod", addrs.IntKey(1))).SetResourceInstanceCurrent( mustResourceInstanceAddr("aws_instance.foo").Resource, @@ -5797,18 +5797,16 @@ resource "aws_instance" "foo" { Status: states.ObjectReady, AttrsJSON: []byte(`{"id":"child"}`), }, - mustProviderConfig(`provider["registry.terraform.io/-/aws"]`), + mustProviderConfig(`provider["registry.terraform.io/hashicorp/aws"]`), ) p := testProvider("aws") p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Config: m, - ProviderResolver: providers.ResolverFixed( - map[addrs.Provider]providers.Factory{ - addrs.NewLegacyProvider("aws"): testProviderFuncFixed(p), - }, - ), + Providers: map[addrs.Provider]providers.Factory{ + addrs.NewDefaultProvider("aws"): testProviderFuncFixed(p), + }, State: state, }) diff --git a/terraform/context_validate_test.go b/terraform/context_validate_test.go index a8d85498c..8b380ba03 100644 --- a/terraform/context_validate_test.go +++ b/terraform/context_validate_test.go @@ -1452,11 +1452,9 @@ resource "aws_instance" "foo" { p.DiffFn = testDiffFn ctx := testContext2(t, &ContextOpts{ Config: m, - ProviderResolver: providers.ResolverFixed( - map[addrs.Provider]providers.Factory{ - addrs.NewLegacyProvider("aws"): testProviderFuncFixed(p), - }, - ), + Providers: map[addrs.Provider]providers.Factory{ + addrs.NewDefaultProvider("aws"): testProviderFuncFixed(p), + }, }) diags := ctx.Validate() diff --git a/terraform/graph_builder_refresh_test.go b/terraform/graph_builder_refresh_test.go index 3f3962a3a..34dd06b08 100644 --- a/terraform/graph_builder_refresh_test.go +++ b/terraform/graph_builder_refresh_test.go @@ -4,6 +4,7 @@ import ( "strings" "testing" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/states" ) @@ -62,7 +63,7 @@ provider["registry.terraform.io/hashicorp/test"] (close) - *terraform.graphNodeC test_object.foo[1] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject test_object.foo[2] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject root - *terraform.nodeCloseModule - provider["registry.terraform.io/-/test"] (close) - *terraform.graphNodeCloseProvider + provider["registry.terraform.io/hashicorp/test"] (close) - *terraform.graphNodeCloseProvider test_object.foo - *terraform.nodeExpandRefreshableManagedResource provider["registry.terraform.io/hashicorp/test"] - *terraform.NodeApplyableProvider test_object.foo[0] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject @@ -73,6 +74,6 @@ test_object.foo[2] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstan provider["registry.terraform.io/hashicorp/test"] - *terraform.NodeApplyableProvider `) if expected != actual { - t.Fatalf("wrong result\n\ngot:\n%s\n\nwant:\n%s", actual, expected) + t.Fatalf("wrong result\n\ngot:\n%s\n\nwant:\n%s\ndiff:\n%s", actual, expected, cmp.Diff(expected, actual)) } }