From 1d41331019b0a2e99da1814afeded449c666d4b6 Mon Sep 17 00:00:00 2001 From: Rajagopalan Subrahmanian Date: Thu, 18 Jul 2024 11:05:25 -0400 Subject: [PATCH] use a random name for test registry --- apstra/test_utils/telemetry_service_registry_entry.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apstra/test_utils/telemetry_service_registry_entry.go b/apstra/test_utils/telemetry_service_registry_entry.go index 2c77da58..f7abac4f 100644 --- a/apstra/test_utils/telemetry_service_registry_entry.go +++ b/apstra/test_utils/telemetry_service_registry_entry.go @@ -2,6 +2,7 @@ package testutils import ( "context" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "testing" "github.com/Juniper/apstra-go-sdk/apstra" @@ -59,23 +60,18 @@ func TelemetryServiceRegistryEntryA(t testing.TB, ctx context.Context) *apstra.T } }`) request := apstra.TelemetryServiceRegistryEntry{ - ServiceName: "TestTelemetryServiceA", + ServiceName: acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum), ApplicationSchema: schema, StorageSchemaPath: apstra.StorageSchemaPathIBA_INTEGER_DATA, Builtin: false, Description: "Test Telemetry Service A", Version: "", } - ts, err := client.GetTelemetryServiceRegistryEntry(ctx, "TestTelemetryServiceA") - require.NoError(t, err) - if ts != nil { - return ts - } sn, err := client.CreateTelemetryServiceRegistryEntry(ctx, &request) require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.DeleteTelemetryServiceRegistryEntry(ctx, sn)) }) - ts, err = client.GetTelemetryServiceRegistryEntry(ctx, sn) + ts, err := client.GetTelemetryServiceRegistryEntry(ctx, sn) require.NoError(t, err) return ts