@@ -895,11 +895,11 @@ describe('#validateServiceProxies()', () => {
895895 )
896896 }
897897
898- const shouldSucceed = ( key , value ) => {
898+ const shouldSucceed = ( key , value , ... missing ) => {
899899 serverlessApigatewayServiceProxy . serverless . service . custom = {
900900 apiGatewayServiceProxies : [
901901 {
902- s3 : getProxy ( key , value )
902+ s3 : getProxy ( key , value , ... missing )
903903 }
904904 ]
905905 }
@@ -1026,6 +1026,34 @@ describe('#validateServiceProxies()', () => {
10261026 it ( 'should not throw if requestParameters is a string to string mapping' , ( ) => {
10271027 shouldSucceed ( 'requestParameters' , { key1 : 'value1' , key2 : 'value2' } )
10281028 } )
1029+
1030+ it ( 'should throw if requestParameters has "integration.request.path.object" and key is defined' , ( ) => {
1031+ shouldError (
1032+ 'child "s3" fails because [child "key" fails because ["key" is not allowed]]' ,
1033+ 'requestParameters' ,
1034+ {
1035+ 'integration.request.path.object' : 'context.requestId' ,
1036+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1037+ }
1038+ )
1039+ } )
1040+
1041+ it ( 'should not throw if requestParameters has "integration.request.path.object" and key is not defined' , ( ) => {
1042+ shouldSucceed (
1043+ 'requestParameters' ,
1044+ {
1045+ 'integration.request.path.object' : 'context.requestId' ,
1046+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1047+ } ,
1048+ 'key'
1049+ )
1050+ } )
1051+
1052+ it ( `should not throw if requestParameters doesn't have "integration.request.path.object" and key is defined` , ( ) => {
1053+ shouldSucceed ( 'requestParameters' , {
1054+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1055+ } )
1056+ } )
10291057 } )
10301058
10311059 describe ( 'sns' , ( ) => {
0 commit comments