mercredi 22 juillet 2020

AWS SAM - Test lambda was invoked, test kinesis event was created

I'm investigating whether AWS SAM can be used within the context of an application I'm working on.

Basically the structure of the application is that you have things like:

[kinesis event] -> [my lambda] -> [invokes another lambda]

or

[kinesis event] -> [my lambda] -> [creates a different kinesis event]

or

[another lambda] => [invokes my lambda] => [invokes yet another lambda]

So what I want to be able to is write some tests like:

Given that I invoke myLambda with data ABC,
 then I expect otherLambda to have been invoked with DEF. 

or

Given that I put event ABC on the kinesis stream,
 then I expect that myLamdba was executed,
 and I expect that it put event DEF on the kinesis stream

While I can see all of the functionality for invoking lambdas locally, I can't see any functionality about making assertions against other lambdas being called etc.

Is this out of scope of what AWS SAM does?

Aucun commentaire:

Enregistrer un commentaire