@restatedev/restate-sdk-testcontainers.
This uses Testcontainers to run a Restate Server in a Docker container and let you test your Restate handlers.
Setup
RestateTestEnvironment.start creates a Restate container and executes a user-provided closure to register services.
An optional second argument allows you to specify a custom Testcontainer for Restate.
Calling services
The Restate ingress client can be used as usual (see the clients documentation)Checking and mutating state
ThestateOf method on the RestateTestEnvironment class can be used to obtain a handle on the Virtual Object / Workflow state
for a particular key.
Typed state
stateOf can be provided with a type for the services state, to allow for type-safe state operations.