Order submitted leg
The next leg of the end-to-end scenario asserts the order-submitted contract between the BFF component and the EO component. The order-submitted event is emitted using the database-first variant of the event sourcing pattern. To drive this test case, we need to capture the event payload produced by the DynamoDB stream of the orders table. There is no fancy way to capture this payload. We simply copy the JSON string from the CloudWatch log of the trigger function and store it as a file in the BFF project. This string should be present in the log shortly after recording the submit-order leg.
This test directly invokes the trigger function handler with the captured DynamoDB stream event. We initialize the Replay VCR so that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access