Skip to content

Commit

Permalink
fix: expanded test cases
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 e4e35cb commit fd81d92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/provider/integration_email_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ func TestAccEmailIntegrationResource(t *testing.T) {
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"),
),
},
{
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"),
),
},
// Update and Read testing
Expand All @@ -42,13 +45,16 @@ func TestAccEmailIntegrationResource(t *testing.T) {
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"),
),
},
{
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"),
),
},
// Delete testing automatically occurs in TestCase
Expand Down

0 comments on commit fd81d92

Please sign in to comment.