@@ -70,11 +70,11 @@ struct LambdaRuntimeTest : public ::testing::Test {
70
70
return {};
71
71
}
72
72
73
- void create_function (Aws::String const & name )
73
+ void create_function (Aws::String const & function_name, Aws::String const & handler_name )
74
74
{
75
75
Model::CreateFunctionRequest createFunctionRequest;
76
- createFunctionRequest.SetHandler (name );
77
- createFunctionRequest.SetFunctionName (name );
76
+ createFunctionRequest.SetHandler (handler_name );
77
+ createFunctionRequest.SetFunctionName (function_name );
78
78
// I ran into eventual-consistency issues when creating the role dynamically as part of the test.
79
79
createFunctionRequest.SetRole (get_role_arn (" integration-tests" ));
80
80
Model::FunctionCode funcode;
@@ -83,16 +83,16 @@ struct LambdaRuntimeTest : public ::testing::Test {
83
83
createFunctionRequest.SetRuntime (Aws::Lambda::Model::Runtime::provided);
84
84
85
85
auto outcome = m_lambda_client.CreateFunction (createFunctionRequest);
86
- ASSERT_TRUE (outcome.IsSuccess ()) << " Failed to create function " << name ;
86
+ ASSERT_TRUE (outcome.IsSuccess ()) << " Failed to create function " << function_name ;
87
87
}
88
88
89
- void delete_function (Aws::String const & name , bool assert = true )
89
+ void delete_function (Aws::String const & function_name , bool assert = true )
90
90
{
91
91
Model::DeleteFunctionRequest deleteFunctionRequest;
92
- deleteFunctionRequest.SetFunctionName (name );
92
+ deleteFunctionRequest.SetFunctionName (function_name );
93
93
auto outcome = m_lambda_client.DeleteFunction (deleteFunctionRequest);
94
94
if (assert) {
95
- ASSERT_TRUE (outcome.IsSuccess ()) << " Failed to delete function " << name ;
95
+ ASSERT_TRUE (outcome.IsSuccess ()) << " Failed to delete function " << function_name ;
96
96
}
97
97
}
98
98
};
@@ -101,7 +101,7 @@ TEST_F(LambdaRuntimeTest, echo_success)
101
101
{
102
102
Aws::String const funcname = build_resource_name (" echo_success" );
103
103
char const payloadContent[] = " Hello, Lambda!" ;
104
- create_function (funcname);
104
+ create_function (funcname, " echo_success " /* handler_name */ );
105
105
Model::InvokeRequest invokeRequest;
106
106
invokeRequest.SetFunctionName (funcname);
107
107
invokeRequest.SetInvocationType (Model::InvocationType::RequestResponse);
@@ -132,7 +132,7 @@ TEST_F(LambdaRuntimeTest, echo_unicode)
132
132
{
133
133
Aws::String const funcname = build_resource_name (" echo_success" ); // re-use the echo method but with Unicode input
134
134
char const payloadContent[] = " 画像は1000語の価値がある" ;
135
- create_function (funcname);
135
+ create_function (funcname, " echo_success " /* handler_name */ );
136
136
Model::InvokeRequest invokeRequest;
137
137
invokeRequest.SetFunctionName (funcname);
138
138
invokeRequest.SetInvocationType (Model::InvocationType::RequestResponse);
@@ -162,7 +162,7 @@ TEST_F(LambdaRuntimeTest, echo_unicode)
162
162
TEST_F (LambdaRuntimeTest, echo_failure)
163
163
{
164
164
Aws::String const funcname = build_resource_name (" echo_failure" );
165
- create_function (funcname);
165
+ create_function (funcname, " echo_failure " /* handler_name */ );
166
166
Model::InvokeRequest invokeRequest;
167
167
invokeRequest.SetFunctionName (funcname);
168
168
invokeRequest.SetInvocationType (Model::InvocationType::RequestResponse);
@@ -178,7 +178,7 @@ TEST_F(LambdaRuntimeTest, binary_response)
178
178
{
179
179
Aws::String const funcname = build_resource_name (" binary_response" );
180
180
unsigned long constexpr expected_length = 1451 ;
181
- create_function (funcname);
181
+ create_function (funcname, " binary_response " /* handler_name */ );
182
182
Model::InvokeRequest invokeRequest;
183
183
invokeRequest.SetFunctionName (funcname);
184
184
invokeRequest.SetInvocationType (Model::InvocationType::RequestResponse);
@@ -190,3 +190,4 @@ TEST_F(LambdaRuntimeTest, binary_response)
190
190
EXPECT_EQ (expected_length, invokeOutcome.GetResult ().GetPayload ().tellp ());
191
191
delete_function (funcname);
192
192
}
193
+ } // namespace
0 commit comments