Skip to content

Commit

Permalink
fix: [PL-38540]: Fixed tests by fixing the name to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
VikasMaddukuriHarness committed May 16, 2023
1 parent d262462 commit f42ede8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
12 changes: 6 additions & 6 deletions internal/service/platform/api_key/apiKey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestAccResourceApiKey(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestAccResourceApiKeyOrgLevel(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestAccResourceApiKeyProjectLevel(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -141,7 +141,7 @@ func testAccGetResourceApiKey(resourceName string, state *terraform.State) (*nex

func testAccResourceApiKey(id string, name string, parentId string, accountId string) string {
return fmt.Sprintf(`
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -160,7 +160,7 @@ func testOrgResourceApiKey(id string, name string, parentId string, accountId st
name = "%[2]s"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -187,7 +187,7 @@ func testProjectResourceApiKey(id string, name string, parentId string, accountI
color = "#472848"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand Down
54 changes: 27 additions & 27 deletions internal/service/platform/api_key/data_source_apiKey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestAccDataSourceApiKey(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -41,7 +41,7 @@ func TestAccDataSourceApiKeyOrgLevel(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -66,7 +66,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -87,7 +87,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) {

func testAccDataSourceApiKey(id string, name string, parentId string, accountId string) string {
return fmt.Sprintf(`
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -97,12 +97,12 @@ func testAccDataSourceApiKey(id string, name string, parentId string, accountId
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}
Expand All @@ -115,7 +115,7 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac
name = "%[2]s"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -126,13 +126,13 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
org_id = harness_platform_apiKey.test.org_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
org_id = harness_platform_apikey.test.org_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}
Expand All @@ -151,7 +151,7 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string
color = "#472848"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -163,14 +163,14 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
org_id = harness_platform_apiKey.test.org_id
project_id = harness_platform_apiKey.test.project_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
org_id = harness_platform_apikey.test.org_id
project_id = harness_platform_apikey.test.project_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}

0 comments on commit f42ede8

Please sign in to comment.