From c87137bdad87982b4550c12361fb6aef19d709ee Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 18 Oct 2022 11:51:26 -0400 Subject: [PATCH] skaff: update datasource ErrorCheck generation --- skaff/datasource/datasourcetest.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skaff/datasource/datasourcetest.tmpl b/skaff/datasource/datasourcetest.tmpl index 681d44e2c73..430c50fbce8 100644 --- a/skaff/datasource/datasourcetest.tmpl +++ b/skaff/datasource/datasourcetest.tmpl @@ -66,6 +66,9 @@ import ( // any normal context constants, variables, or functions. {{- end }} tf{{ .ServicePackage }} "github.com/hashicorp/terraform-provider-aws/internal/service/{{ .ServicePackage }}" +{{- if .AWSGoSDKV2 }} + "github.com/hashicorp/terraform-provider-aws/names" +{{- end }} ) {{ if .IncludeComments }} // TIP: File Structure. The basic outline for all test files should be as @@ -172,7 +175,11 @@ func TestAcc{{ .Service }}{{ .DataSource }}DataSource_basic(t *testing.T) { acctest.PreCheckPartitionHasService({{ .ServicePackage }}.EndpointsID, t) testAccPreCheck(t) }, + {{- if .AWSGoSDKV2 }} + ErrorCheck: acctest.ErrorCheck(t, names.{{ .Service }}EndpointID), + {{- else }} ErrorCheck: acctest.ErrorCheck(t, {{ .ServicePackage }}.EndpointsID), + {{- end }} ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheck{{ .DataSource }}Destroy, Steps: []resource.TestStep{