Skip to content

Commit fb71234

Browse files
committed
feat(dynamodb): test custom request template is created
1 parent f7ce36e commit fb71234

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lib/package/dynamodb/compileMethodsToDynamodb.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,30 @@ describe('#compileMethodsToDynamodb()', () => {
393393
{}
394394
)
395395
})
396+
397+
it('should create a custom request template when one is given', () => {
398+
const customRequestTemplate = "#set($inputRoot = $input.path('$'))\n{ }"
399+
testPutItem(
400+
{
401+
hashKey: { pathParam: 'id', attributeType: 'S' },
402+
rangeKey: { pathParam: 'range', attributeType: 'S' },
403+
path: '/dynamodb/{id}/{range}',
404+
condition: 'attribute_not_exists(id)',
405+
action: 'PutItem',
406+
request: {
407+
template: {
408+
'application/json': customRequestTemplate,
409+
'application/x-www-form-urlencoded': customRequestTemplate
410+
}
411+
}
412+
},
413+
{
414+
'application/json': customRequestTemplate,
415+
'application/x-www-form-urlencoded': customRequestTemplate
416+
},
417+
{}
418+
)
419+
})
396420
})
397421

398422
describe('#get method', () => {

0 commit comments

Comments
 (0)