Skip to content

Commit

Permalink
added test for run_updated event
Browse files Browse the repository at this point in the history
  • Loading branch information
pazhersh committed Jul 28, 2024
1 parent 379b1d6 commit 45b88a1
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions port/action/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,49 @@ func TestAccPortAutomationTimerPropertyExpired(t *testing.T) {
})
}

func TestAccPortAutomationRunUpdated(t *testing.T) {
identifier := utils.GenID()
actionIdentifier := utils.GenID()
var testAccActionConfigCreate = testAccCreateBlueprintConfig(identifier) + fmt.Sprintf(`
resource "port_action" "self_serve_action" {
title = "self serve action"
identifier = "self_serve_action"
icon = "Terraform"
self_service_trigger = {
operation = "CREATE"
}
kafka_method = {}
}
resource "port_action" "create_microservice" {
title = "TF Provider Test"
identifier = "%s"
icon = "Terraform"
automation_trigger = {
run_updated_event = {
action_identifier = "self_serve_action"
}
}
kafka_method = {}
depends_on = [port_action.self_serve_action]
}`, actionIdentifier)
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: acctest.ProviderConfig + testAccActionConfigCreate,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_action.create_microservice", "title", "TF Provider Test"),
resource.TestCheckResourceAttr("port_action.create_microservice", "identifier", actionIdentifier),
resource.TestCheckResourceAttr("port_action.create_microservice", "icon", "Terraform"),
resource.TestCheckResourceAttr("port_action.create_microservice", "automation_trigger.run_updated_event.action_identifier", "self_serve_action"),
),
},
},
})
}

func TestAccPortWebhookApproval(t *testing.T) {
identifier := utils.GenID()
actionIdentifier := utils.GenID()
Expand Down

0 comments on commit 45b88a1

Please sign in to comment.