@@ -256,6 +256,33 @@ func TestAWSLambdaCustomRuntime_Invoke(t *testing.T) {
256
256
want : `{"name":"WinterYukky"}` ,
257
257
wantErr : false ,
258
258
},
259
+ {
260
+ name : "String result is output as is" ,
261
+ fields : fields {
262
+ awsLambdaRuntimeAPI : "unit-test-runtime-api" ,
263
+ httpClient : NewMockHTTPClient (MockHTTPClientProps {
264
+ GetEvent : func (req * http.Request ) (* http.Response , error ) {
265
+ if req .URL .String () != "http://unit-test-runtime-api/2018-06-01/runtime/invocation/next" {
266
+ return nil , fmt .Errorf ("get event URL is should http://$AWS_LAMBDA_RUNTIME_API/2018-06-01/runtime/invocation/next, got %v" , req .URL .String ())
267
+ }
268
+ return & http.Response {
269
+ Body : NewBody (`{"key1":"value1"}` ),
270
+ }, nil
271
+ },
272
+ Response : func (req * http.Request ) (* http.Response , error ) {
273
+ return & http.Response {}, nil
274
+ },
275
+ }),
276
+ runtime : & InstantRuntime {
277
+ setup : func (env * AWSLambdaRuntimeEnvironemnt ) error { return nil },
278
+ invoke : func (event []byte , context * Context ) (interface {}, error ) {
279
+ return `{"name":"WinterYukky"}` , nil
280
+ },
281
+ },
282
+ },
283
+ want : `{"name":"WinterYukky"}` ,
284
+ wantErr : false ,
285
+ },
259
286
}
260
287
for _ , tt := range tests {
261
288
t .Run (tt .name , func (t * testing.T ) {
0 commit comments