diff --git a/octopusdeploy_framework/resource_oci_registry_feed_test.go b/octopusdeploy_framework/resource_oci_registry_feed_test.go index 657630c5..6c65f0a8 100644 --- a/octopusdeploy_framework/resource_oci_registry_feed_test.go +++ b/octopusdeploy_framework/resource_oci_registry_feed_test.go @@ -19,12 +19,18 @@ type ociRegistryFeedTestData struct { func TestAccOctopusDeployOCIRegistryFeed(t *testing.T) { localName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) prefix := "octopusdeploy_oci_registry_feed." + localName - data := ociRegistryFeedTestData{ + createData := ociRegistryFeedTestData{ name: acctest.RandStringFromCharSet(20, acctest.CharSetAlpha), uri: "oci://integration-test-registry.docker.io", username: acctest.RandStringFromCharSet(20, acctest.CharSetAlpha), password: acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum), } + updateData := ociRegistryFeedTestData{ + name: createData.name + "-updated", + uri: "oci://integration-test-registry-updated.docker.io", + username: createData.username + "-changed", + password: createData.password + "-generated", + } resource.Test(t, resource.TestCase{ CheckDestroy: func(s *terraform.State) error { return testOCIRegistryFeedCheckDestroy(s) }, @@ -32,12 +38,12 @@ func TestAccOctopusDeployOCIRegistryFeed(t *testing.T) { ProtoV6ProviderFactories: ProtoV6ProviderFactories(), Steps: []resource.TestStep{ { - Config: testOCIRegistryFeedBasic(data, localName), - Check: testAssertOCIRegistryAttributes(data, prefix), + Config: testOCIRegistryFeedBasic(createData, localName), + Check: testAssertOCIRegistryAttributes(createData, prefix), }, { - Config: testOCIRegistryFeedBasicUpdate(data, localName), - Check: testAssertOCIRegistryAttributes(data, prefix), + Config: testOCIRegistryFeedBasic(updateData, localName), + Check: testAssertOCIRegistryAttributes(updateData, prefix), }, }, }) @@ -69,15 +75,6 @@ func testOCIRegistryFeedBasic(data ociRegistryFeedTestData, localName string) st ) } -func testOCIRegistryFeedBasicUpdate(data ociRegistryFeedTestData, localName string) string { - data.name = data.name + "-updated" - data.uri = "oci://integration-test-registry-updated.docker.io" - data.username = data.username + "-changed" - data.password = data.password + "-generated" - - return testOCIRegistryFeedBasic(data, localName) -} - func testOCIRegistryFeedCheckDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "octopusdeploy_oci_registry_feed" {