@@ -28,15 +28,25 @@ describe('#methods()', () => {
28
28
} ;
29
29
serverlessStepFunctions . apiGatewayResourceLogicalIds
30
30
= { 'foo/bar' : 'apiGatewayResourceLogicalId' } ;
31
- serverlessStepFunctions . apiGatewayResourceNames
32
- = { 'foo/bar' : 'apiGatewayResourceNames' } ;
31
+ serverlessStepFunctions . apiGatewayResourceNames = {
32
+ 'foo/bar1' : 'apiGatewayResourceNamesFirst' ,
33
+ 'foo/bar2' : 'apiGatewayResourceNamesSecond' ,
34
+ } ;
33
35
serverlessStepFunctions . pluginhttpValidated = {
34
36
events : [
35
37
{
36
38
stateMachineName : 'first' ,
37
39
http : {
38
- path : 'foo/bar' ,
40
+ path : 'foo/bar1' ,
41
+ method : 'post' ,
42
+ } ,
43
+ } ,
44
+ {
45
+ stateMachineName : 'first' ,
46
+ http : {
47
+ path : 'foo/bar2' ,
39
48
method : 'post' ,
49
+ private : true ,
40
50
} ,
41
51
} ,
42
52
] ,
@@ -48,9 +58,22 @@ describe('#methods()', () => {
48
58
. compileMethods ( ) . then ( ( ) => {
49
59
expect ( serverlessStepFunctions . serverless . service . provider . compiledCloudFormationTemplate
50
60
. Resources )
51
- . to . have . property ( 'ApiGatewayMethodapiGatewayResourceNamesPost ' ) ;
61
+ . to . have . property ( 'ApiGatewayMethodapiGatewayResourceNamesFirstPost ' ) ;
52
62
} )
53
63
) ;
64
+
65
+ it ( 'should verify if http private parameter is correctly passed to resource' ,
66
+ ( ) => serverlessStepFunctions
67
+ . compileMethods ( ) . then ( ( ) => {
68
+ const resources = serverlessStepFunctions
69
+ . serverless . service . provider . compiledCloudFormationTemplate . Resources ;
70
+
71
+ expect ( resources . ApiGatewayMethodapiGatewayResourceNamesFirstPost
72
+ . Properties . ApiKeyRequired ) . to . eql ( false ) ;
73
+ expect ( resources . ApiGatewayMethodapiGatewayResourceNamesSecondPost
74
+ . Properties . ApiKeyRequired ) . to . eql ( true ) ;
75
+ } )
76
+ ) ;
54
77
} ) ;
55
78
56
79
describe ( '#getMethodIntegration()' , ( ) => {
0 commit comments