-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #875 from imjaroiswebdev/support-user-handoff-notif
Add support for user handoff notification rules
- Loading branch information
Showing
46 changed files
with
3,195 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
pagerdutyplugin/import_pagerduty_user_handoff_notification_rule_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package pagerduty | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-testing/terraform" | ||
) | ||
|
||
func TestAccPagerDutyUserHandoffNotificationRule_import(t *testing.T) { | ||
userName := fmt.Sprintf("tf-%s", acctest.RandString(5)) | ||
contactMethodType := "phone_contact_method" | ||
handoffType := "both" | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(), | ||
CheckDestroy: testAccCheckPagerDutyUserHandoffNotificationRuleDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccCheckPagerDutyUserHandoffNotificationRuleConfig(userName, contactMethodType, handoffType), | ||
}, | ||
{ | ||
ResourceName: "pagerduty_user_handoff_notification_rule.foo", | ||
ImportStateIdFunc: testAccCheckPagerDutyUserHandoffNotificationRuleID, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccCheckPagerDutyUserHandoffNotificationRuleID(s *terraform.State) (string, error) { | ||
return fmt.Sprintf("%v.%v", s.RootModule().Resources["pagerduty_user.foo"].Primary.ID, s.RootModule().Resources["pagerduty_user_handoff_notification_rule.foo"].Primary.ID), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.