Skip to content

Commit

Permalink
Some additional unit test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Apr 9, 2021
1 parent addbc8f commit f462b32
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions aws/internal/service/cloudwatchevents/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ func TestRuleParseID(t *testing.T) {
{
TestName: "single part",
InputID: "TestRule",
ExpectedPart0: "default",
ExpectedPart0: tfevents.DefaultEventBusName,
ExpectedPart1: "TestRule",
},
{
TestName: "two parts",
InputID: "TestEventBus/TestRule",
InputID: tfevents.RuleCreateID("TestEventBus", "TestRule"),
ExpectedPart0: "TestEventBus",
ExpectedPart1: "TestRule",
},
{
TestName: "two parts with default event bus",
InputID: tfevents.RuleCreateID(tfevents.DefaultEventBusName, "TestRule"),
ExpectedPart0: tfevents.DefaultEventBusName,
ExpectedPart1: "TestRule",
},
{
TestName: "partner event bus",
InputID: "aws.partner/example.com/Test/TestRule",
Expand Down Expand Up @@ -119,7 +125,7 @@ func TestTargetParseImportID(t *testing.T) {
{
TestName: "two parts",
InputID: "TestTarget/TestRule",
ExpectedPart0: "default",
ExpectedPart0: tfevents.DefaultEventBusName,
ExpectedPart1: "TestTarget",
ExpectedPart2: "TestRule",
},
Expand All @@ -130,6 +136,13 @@ func TestTargetParseImportID(t *testing.T) {
ExpectedPart1: "TestRule",
ExpectedPart2: "TestTarget",
},
{
TestName: "three parts with default event bus",
InputID: tfevents.DefaultEventBusName + "/TestRule/TestTarget",
ExpectedPart0: tfevents.DefaultEventBusName,
ExpectedPart1: "TestRule",
ExpectedPart2: "TestTarget",
},
{
TestName: "empty two parts",
InputID: "/",
Expand Down

0 comments on commit f462b32

Please sign in to comment.