From aa9c9e54ff27211131ec823a34a3d8d77dc55cf2 Mon Sep 17 00:00:00 2001 From: Dora Korpar Date: Fri, 21 Aug 2020 13:13:54 -0700 Subject: [PATCH] ft: S3C-2797 queue arn parsing --- lib/models/NotificationConfiguration.js | 2 +- tests/unit/models/NotificationConfiguration.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/models/NotificationConfiguration.js b/lib/models/NotificationConfiguration.js index bdabd99eb..c303e7810 100644 --- a/lib/models/NotificationConfiguration.js +++ b/lib/models/NotificationConfiguration.js @@ -100,7 +100,7 @@ class NotificationConfiguration { const eventObj = this._parseEvents(queueConfig[i].Event); const filterObj = this._parseFilter(queueConfig[i].Filter); const idObj = this._parseId(queueConfig[i].Id); - const arnObj = this._parseArn(queueConfig[i].QueueArn); + const arnObj = this._parseArn(queueConfig[i].Queue); if (eventObj.error) { parseError = eventObj.error; diff --git a/tests/unit/models/NotificationConfiguration.js b/tests/unit/models/NotificationConfiguration.js index 046d83dd1..df76bc7b0 100644 --- a/tests/unit/models/NotificationConfiguration.js +++ b/tests/unit/models/NotificationConfiguration.js @@ -53,8 +53,8 @@ function generateFilter(testParams) { function generateXml(testParams) { const id = testParams.key === 'Id' ? `${testParams.value}` : 'queue-id'; const arn = testParams.key === 'QueueArn' ? - `${testParams.value}` : - 'arn:scality:bucketnotif:::target'; + `${testParams.value}` : + 'arn:scality:bucketnotif:::target'; const event = generateEvent(testParams); const filter = generateFilter(testParams); let queueConfig = `${id}${arn}${event}${filter}` + @@ -88,7 +88,7 @@ const failTests = [ }, { name: 'fail with empty QueueConfiguration', - params: { key: 'QueueConfiguration', value: 'arn:scality:bucketnotif:::target' }, + params: { key: 'QueueConfiguration', value: 'arn:scality:bucketnotif:::target' }, error: 'MalformedXML', errorMessage: 'request xml does not include QueueConfiguration', },