Package dev.restate.sdk.testing
Class ManualRestateRunner
- java.lang.Object
-
- dev.restate.sdk.testing.ManualRestateRunner
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
public class ManualRestateRunner extends java.lang.Object implements java.lang.AutoCloseable, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResourceManual runner for Restate. We recommend usingRestateRunnerwith JUnit 5.
-
-
Field Summary
Fields Modifier and Type Field Description static intRESTATE_ADMIN_ENDPOINT_PORTstatic intRESTATE_INGRESS_ENDPOINT_PORT
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Likestop().java.net.URLgetAdminUrl()Get restate admin url to send HTTP requests to the admin API.org.testcontainers.containers.GenericContainer<?>getRestateContainer()Get the restate container.java.net.URLgetRestateUrl()Get restate ingress url to send HTTP/gRPC requests to services.voidrun()Run restate, run the embedded service endpoint server, and register the services.voidstop()Stop restate and the embedded service endpoint server.
-
-
-
Field Detail
-
RESTATE_INGRESS_ENDPOINT_PORT
public static final int RESTATE_INGRESS_ENDPOINT_PORT
- See Also:
- Constant Field Values
-
RESTATE_ADMIN_ENDPOINT_PORT
public static final int RESTATE_ADMIN_ENDPOINT_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
run
public void run()
Run restate, run the embedded service endpoint server, and register the services.
-
getRestateUrl
public java.net.URL getRestateUrl()
Get restate ingress url to send HTTP/gRPC requests to services.- Throws:
java.lang.IllegalStateException- if the restate container is not running.
-
getAdminUrl
public java.net.URL getAdminUrl()
Get restate admin url to send HTTP requests to the admin API.- Throws:
java.lang.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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceorg.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
-
-