Skip to content

Commit

Permalink
fix: changed resource name for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Theuermann <[email protected]>
  • Loading branch information
mati007thm committed Dec 9, 2024
1 parent fd81d92 commit 08eb9ea
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions internal/provider/integration_email_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ func TestAccEmailIntegrationResource(t *testing.T) {
{"name": "Alice Doe", "email": "[email protected]", "is_default": false, "reference_url": "https://example.com"},
}),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "name", "one"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "recipients.0.name", "John Doe"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "name", "one"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "recipients.0.name", "John Doe"),
),
},
{
Config: testAccEmailIntegrationResourceWithSpaceInProviderConfig(accSpace.ID(), "two", true, true),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "name", "two"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "auto_create", "true"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "auto_close", "true"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "name", "two"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "auto_create", "true"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "auto_close", "true"),
),
},
// Update and Read testing
Expand All @@ -43,18 +43,18 @@ func TestAccEmailIntegrationResource(t *testing.T) {
{"name": "Alice Doe", "email": "[email protected]", "is_default": false, "reference_url": "https://newurl.com"},
}),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "name", "three"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "recipients.0.reference_url", "https://newurl.com"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "name", "three"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "recipients.0.reference_url", "https://newurl.com"),
),
},
{
Config: testAccEmailIntegrationResourceWithSpaceInProviderConfig(accSpace.ID(), "four", false, false),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "name", "four"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "auto_create", "false"),
resource.TestCheckResourceAttr("mondoo_integration_email.email_integration", "auto_close", "false"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "name", "four"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "space_id", accSpace.ID()),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "auto_create", "false"),
resource.TestCheckResourceAttr("mondoo_integration_email.test", "auto_close", "false"),
),
},
// Delete testing automatically occurs in TestCase
Expand All @@ -64,7 +64,7 @@ func TestAccEmailIntegrationResource(t *testing.T) {

func testAccEmailIntegrationResourceConfig(spaceID, intName string, recipients []map[string]interface{}) string {
return fmt.Sprintf(`
resource "mondoo_integration_email" "email_integration" {
resource "mondoo_integration_email" "test" {
space_id = %[1]q
name = %[2]q
recipients = %[3]q
Expand Down

0 comments on commit 08eb9ea

Please sign in to comment.