Skip to content

Commit

Permalink
address a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yamatatsu committed Nov 17, 2021
1 parent d36ed2c commit 1a8aea6
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test('create a topic rule with lambda action and a lambda permission to be invok
});
});

test('When two topic rules have the same action, it should not throw a error', () => {
test('create two different permissions, when two topic rules have the same action', () => {
// GIVEN
const stack = new cdk.Stack();
const func = new lambda.Function(stack, 'MyFunction', {
Expand All @@ -71,12 +71,11 @@ test('When two topic rules have the same action, it should not throw a error', (
sql: iot.IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
actions: [action],
});
new iot.TopicRule(stack, 'MyTopicRule2', {
sql: iot.IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
actions: [action],
});

// THEN
expect(() => {
new iot.TopicRule(stack, 'MyTopicRule2', {
sql: iot.IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
actions: [action],
});
}).not.toThrow();
Template.fromStack(stack).resourceCountIs('AWS::Lambda::Permission', 2);
});

0 comments on commit 1a8aea6

Please sign in to comment.