Skip to content

Commit

Permalink
Fix AccTests - azurerm_redis_enterprise_database (#27070)
Browse files Browse the repository at this point in the history
* Remove deprecated property 'resource_group_name' from tests which deprecated in v4

* format file

* revert test case
  • Loading branch information
xuzhang3 authored Aug 20, 2024
1 parent 3893142 commit 067db3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ func TestAccRedisEnterpriseDatabaseDataSource_standard(t *testing.T) {
data := acceptance.BuildTestData(t, "data.azurerm_redis_enterprise_database", "test")
r := RedisEnterpriseDatabaseDataSource{}

resourceGroupName := fmt.Sprintf("acctestRG-redisEnterprise-%d", data.RandomInteger)

data.DataSourceTest(t, []acceptance.TestStep{
{
Config: r.dataSource(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).Key("name").HasValue("default"),
check.That(data.ResourceName).Key("resource_group_name").HasValue(resourceGroupName),
check.That(data.ResourceName).Key("cluster_id").Exists(),
check.That(data.ResourceName).Key("primary_access_key").Exists(),
check.That(data.ResourceName).Key("secondary_access_key").Exists(),
Expand All @@ -37,14 +34,11 @@ func TestAccRedisEnterpriseDatabaseDataSource_geoDatabase(t *testing.T) {
data := acceptance.BuildTestData(t, "data.azurerm_redis_enterprise_database", "test")
r := RedisEnterpriseDatabaseDataSource{}

resourceGroupName := fmt.Sprintf("acctestRG-redisEnterprise-%d", data.RandomInteger)

data.DataSourceTest(t, []acceptance.TestStep{
{
Config: r.dataSourceGeoDatabase(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).Key("name").HasValue("default"),
check.That(data.ResourceName).Key("resource_group_name").HasValue(resourceGroupName),
check.That(data.ResourceName).Key("cluster_id").Exists(),
check.That(data.ResourceName).Key("linked_database_id.#").Exists(),
check.That(data.ResourceName).Key("linked_database_group_nickname").Exists(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,19 @@ resource "azurerm_redis_enterprise_cluster" "test" {
name = "acctest-rec-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku_name = "Enterprise_E20-4"
sku_name = "Enterprise_E20-4"
}
resource "azurerm_redis_enterprise_cluster" "test1" {
name = "acctest-rec-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku_name = "Enterprise_E20-4"
sku_name = "Enterprise_E20-4"
}
resource "azurerm_redis_enterprise_cluster" "test2" {
name = "acctest-rec-%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku_name = "Enterprise_E20-4"
sku_name = "Enterprise_E20-4"
}
`, data.RandomInteger, "eastus", data.RandomInteger, data.RandomInteger, data.RandomInteger)
}
Expand Down

0 comments on commit 067db3f

Please sign in to comment.