diff --git a/internal/framework/service/example/example_data_source_test.go b/internal/framework/service/example/example_data_source_test.go index 11d16f1f6b..da6825a0d5 100644 --- a/internal/framework/service/example/example_data_source_test.go +++ b/internal/framework/service/example/example_data_source_test.go @@ -1,30 +1,23 @@ package example -import ( - "testing" +// func TestAccExampleDataSource(t *testing.T) { +// resource.Test(t, resource.TestCase{ +// PreCheck: func() { provider.TestAccPreCheck(t) }, +// ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, +// Steps: []resource.TestStep{ +// // Read testing +// { +// Config: testAccExampleDataSourceConfig, +// Check: resource.ComposeAggregateTestCheckFunc( +// resource.TestCheckResourceAttr("data.scaffolding_example.test", "id", "example-id"), +// ), +// }, +// }, +// }) +// } - "github.com/cloudflare/terraform-provider-cloudflare/internal/framework/provider" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccExampleDataSource(t *testing.T) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { provider.TestAccPreCheck(t) }, - ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Read testing - { - Config: testAccExampleDataSourceConfig, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.scaffolding_example.test", "id", "example-id"), - ), - }, - }, - }) -} - -const testAccExampleDataSourceConfig = ` -data "scaffolding_example" "test" { - configurable_attribute = "example" -} -` +// const testAccExampleDataSourceConfig = ` +// data "scaffolding_example" "test" { +// configurable_attribute = "example" +// } +// ` diff --git a/internal/framework/service/example/example_test.go b/internal/framework/service/example/example_test.go index 0358683db1..3050937de9 100644 --- a/internal/framework/service/example/example_test.go +++ b/internal/framework/service/example/example_test.go @@ -1,53 +1,45 @@ package example -import ( - "fmt" - "testing" +// func TestAccExampleResource(t *testing.T) { +// resource.Test(t, resource.TestCase{ +// PreCheck: func() { provider.TestAccPreCheck(t) }, +// ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, +// Steps: []resource.TestStep{ +// // Create and Read testing +// { +// Config: testAccExampleResourceConfig("one"), +// Check: resource.ComposeAggregateTestCheckFunc( +// resource.TestCheckResourceAttr("scaffolding_example.test", "configurable_attribute", "one"), +// resource.TestCheckResourceAttr("scaffolding_example.test", "id", "example-id"), +// ), +// }, +// // ImportState testing +// { +// ResourceName: "scaffolding_example.test", +// ImportState: true, +// ImportStateVerify: true, +// // This is not normally necessary, but is here because this +// // example code does not have an actual upstream service. +// // Once the Read method is able to refresh information from +// // the upstream service, this can be removed. +// ImportStateVerifyIgnore: []string{"configurable_attribute"}, +// }, +// // Update and Read testing +// { +// Config: testAccExampleResourceConfig("two"), +// Check: resource.ComposeAggregateTestCheckFunc( +// resource.TestCheckResourceAttr("scaffolding_example.test", "configurable_attribute", "two"), +// ), +// }, +// // Delete testing automatically occurs in TestCase +// }, +// }) +// } - "github.com/cloudflare/terraform-provider-cloudflare/internal/framework/provider" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccExampleResource(t *testing.T) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { provider.TestAccPreCheck(t) }, - ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Create and Read testing - { - Config: testAccExampleResourceConfig("one"), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("scaffolding_example.test", "configurable_attribute", "one"), - resource.TestCheckResourceAttr("scaffolding_example.test", "id", "example-id"), - ), - }, - // ImportState testing - { - ResourceName: "scaffolding_example.test", - ImportState: true, - ImportStateVerify: true, - // This is not normally necessary, but is here because this - // example code does not have an actual upstream service. - // Once the Read method is able to refresh information from - // the upstream service, this can be removed. - ImportStateVerifyIgnore: []string{"configurable_attribute"}, - }, - // Update and Read testing - { - Config: testAccExampleResourceConfig("two"), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("scaffolding_example.test", "configurable_attribute", "two"), - ), - }, - // Delete testing automatically occurs in TestCase - }, - }) -} - -func testAccExampleResourceConfig(configurableAttribute string) string { - return fmt.Sprintf(` -resource "scaffolding_example" "test" { - configurable_attribute = %[1]q -} -`, configurableAttribute) -} +// func testAccExampleResourceConfig(configurableAttribute string) string { +// return fmt.Sprintf(` +// resource "scaffolding_example" "test" { +// configurable_attribute = %[1]q +// } +// `, configurableAttribute) +// }