From c542a70430a00dc8fb1be3fe9f8a4fb5d5240281 Mon Sep 17 00:00:00 2001 From: Benjamin Bennett Date: Thu, 18 Jan 2024 11:41:08 +0000 Subject: [PATCH] Deprecating ExpectNullOutputValue and ExpectNullOutputValueAtPath plan checks (#266) --- plancheck/expect_null_output_value.go | 6 ++++++ plancheck/expect_null_output_value_at_path.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/plancheck/expect_null_output_value.go b/plancheck/expect_null_output_value.go index 540462bf0..1fd27b17e 100644 --- a/plancheck/expect_null_output_value.go +++ b/plancheck/expect_null_output_value.go @@ -64,6 +64,12 @@ func (e expectNullOutputValue) CheckPlan(ctx context.Context, req CheckPlanReque // Due to implementation differences between the terraform-plugin-sdk and the terraform-plugin-framework, representation of null // values may differ. For example, terraform-plugin-sdk based providers may have less precise representations of null values, such // as marking whole maps as null rather than individual element values. +// +// Deprecated: Use ExpectKnownOutputValue with knownvalue.NullExact instead. +// ExpectNullOutputValue will be removed in the next major version release. +// +// [ExpectKnownOutputValue]: https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/plancheck#ExpectKnownOutputValue +// [NullExact]: https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#NullExact func ExpectNullOutputValue(outputAddress string) PlanCheck { return expectNullOutputValue{ outputAddress: outputAddress, diff --git a/plancheck/expect_null_output_value_at_path.go b/plancheck/expect_null_output_value_at_path.go index 17366e21a..4929ec64f 100644 --- a/plancheck/expect_null_output_value_at_path.go +++ b/plancheck/expect_null_output_value_at_path.go @@ -65,6 +65,12 @@ func (e expectNullOutputValueAtPath) CheckPlan(ctx context.Context, req CheckPla // Due to implementation differences between the terraform-plugin-sdk and the terraform-plugin-framework, representation of null // values may differ. For example, terraform-plugin-sdk based providers may have less precise representations of null values, such // as marking whole maps as null rather than individual element values. +// +// Deprecated: Use ExpectKnownOutputValueAtPath with knownvalue.NullExact instead. +// ExpectNullOutputValueAtPath will be removed in the next major version release. +// +// [ExpectKnownOutputValueAtPath]: https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/plancheck#ExpectKnownOutputValueAtPath +// [NullExact]: https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/knownvalue#NullExact func ExpectNullOutputValueAtPath(outputAddress string, valuePath tfjsonpath.Path) PlanCheck { return expectNullOutputValueAtPath{ outputAddress: outputAddress,