Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.74 KB

File metadata and controls

36 lines (28 loc) · 1.74 KB

Step Functions Local Testing using JUnit and Spock

Step Functions Local testing with mock configuration provides the capability to mock AWS service integrations that are present in a state machine. This helps testing the state machine in isolation.

This is sample project which showcases how to run Step Functions local tests with mocks using JUnit and Spock framework instead of running ad-hoc CLI commands. Both type of tests use Testcontainers to run Step Functions Local and ultimately asset results. Let's dive deeper into the details of how they are done.

This is not a replacement of the strategy shown in above blog but another way to test Step Functions state machine with better assertion capabilities. Teams currently using Java for Serverless development can leverage this strategy in their current applications.

Prerequisites

Running Tests

Make sure docker engine is running before running the tests.

In order to run the tests, just run below gradlew task from project directory:

./gradlew test

Tests can also be run individually via IntelliJ's native integrations or your choice of an IDE.

Explanation

Checkout these test classes for details: