From 57dd28286993dcdaf6c42f9a4e7aad5875424f23 Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Thu, 3 Oct 2024 12:42:12 -0400 Subject: [PATCH] fetch client in test for env side effect --- .../resource_telemetry_service_registry_entry_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apstra/resource_telemetry_service_registry_entry_test.go b/apstra/resource_telemetry_service_registry_entry_test.go index 152685c8..82916dfd 100644 --- a/apstra/resource_telemetry_service_registry_entry_test.go +++ b/apstra/resource_telemetry_service_registry_entry_test.go @@ -1,10 +1,13 @@ -package tfapstra +package tfapstra_test import ( + "context" "fmt" "testing" + testutils "github.com/Juniper/terraform-provider-apstra/apstra/test_utils" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" @@ -213,6 +216,11 @@ resource "apstra_telemetry_service_registry_entry" "test" { ) func TestAccResourceTelemetryServiceRegistryEntry(t *testing.T) { + ctx := context.Background() + client := testutils.GetTestClient(t, ctx) + apiVersion := version.Must(version.NewVersion(client.ApiVersion())) + _ = apiVersion + var ( testAccResourceServiceName = acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) testAccResourceServiceRegistryCfg1 = fmt.Sprintf(resourceTelemetryServiceRegistryEntryHCL, testAccResourceServiceName, as1, ss1)