Skip to content

Commit

Permalink
reorganize acc test
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattfry committed Feb 26, 2025
1 parent a86cc25 commit b291a9d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion internal/services/mysql/mysql_flexible_server_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ func TestAccMySqlFlexibleServer_updatePublicNetworkAccess(t *testing.T) {

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.publicNetworkAccess(data, true),
Config: r.defaultPublicNetworkAccess(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
Expand All @@ -587,6 +587,13 @@ func TestAccMySqlFlexibleServer_updatePublicNetworkAccess(t *testing.T) {
),
},
data.ImportStep("administrator_password"),
{
Config: r.publicNetworkAccess(data, true),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("administrator_password"),
})
}

Expand Down Expand Up @@ -1398,3 +1405,19 @@ resource "azurerm_mysql_flexible_server" "test" {
}
`, r.template(data), data.RandomInteger, publicNetworkAccessEnabled)
}

func (r MySqlFlexibleServerResource) defaultPublicNetworkAccess(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_mysql_flexible_server" "test" {
name = "acctest-fs-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
administrator_login = "_admin_Terraform_892123456789312"
administrator_password = "QAZwsx123"
sku_name = "B_Standard_B1s"
zone = "2"
}
`, r.template(data), data.RandomInteger)
}

0 comments on commit b291a9d

Please sign in to comment.