Skip to content

Commit

Permalink
Merge pull request #730 from Juniper/bug/729-fix-Telemetry-Service-Re…
Browse files Browse the repository at this point in the history
…gistry-test

use a random name for test registry
  • Loading branch information
rajagopalans authored Jul 18, 2024
2 parents b511d31 + 1d41331 commit 5ae80da
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions apstra/test_utils/telemetry_service_registry_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package testutils

import (
"context"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"testing"

"github.com/Juniper/apstra-go-sdk/apstra"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ae80da

Please sign in to comment.