Package dev.restate.sdk.testing
Class RestateRunner
java.lang.Object
dev.restate.sdk.testing.RestateRunner
- All Implemented Interfaces:
AutoCloseable
,org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
public class RestateRunner
extends Object
implements AutoCloseable, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
Manual runner for the Restate test infra, starting the Restate server container together with the
provided services and automatically registering them. To start the infra use
start()
and
to stop it use stop()
.
If you use JUnit 5, we suggest using RestateTest
instead.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Likestop()
.static RestateRunner.Builder
Create fromEndpoint
.Get restate admin url to send HTTP requests to the admin API.org.testcontainers.containers.GenericContainer
<?> Get the restate container.Get restate ingress url to send HTTP/gRPC requests to services.void
start()
Run restate, run the embedded service endpoint server, and register the services.void
stop()
Stop restate and the embedded service endpoint server.
-
Field Details
-
RESTATE_INGRESS_ENDPOINT_PORT
public static final int RESTATE_INGRESS_ENDPOINT_PORT- See Also:
-
RESTATE_ADMIN_ENDPOINT_PORT
public static final int RESTATE_ADMIN_ENDPOINT_PORT- See Also:
-
-
Method Details
-
from
Create fromEndpoint
. -
start
public void start()Run restate, run the embedded service endpoint server, and register the services. -
getRestateUrl
Get restate ingress url to send HTTP/gRPC requests to services.- Throws:
IllegalStateException
- if the restate container is not running.
-
getAdminUrl
Get restate admin url to send HTTP requests to the admin API.- Throws:
IllegalStateException
- if the restate container is not running.
-
getRestateContainer
public org.testcontainers.containers.GenericContainer<?> getRestateContainer()Get the restate container. -
stop
public void stop()Stop restate and the embedded service endpoint server. -
close
public void close()Likestop()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceorg.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
-