Class TemporalDevServer
java.lang.Object
io.temporal.testing.TemporalDevServer
- All Implemented Interfaces:
AutoCloseable
A local Temporal dev server owned by the calling process.
try (TemporalDevServer server = TemporalDevServer.start()) {
WorkflowServiceStubs stubs =
WorkflowServiceStubs.newServiceStubs(
WorkflowServiceStubsOptions.newBuilder().setTarget(server.getTarget()).build());
// Use stubs against server.getNamespace().
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops the owned process.Returns the namespace created by the dev server.Returns the usablehost:portgRPC target.static TemporalDevServerstart()Starts a dev server in namespacedefaultwith default options.static TemporalDevServerstart(TemporalDevServerOptions options) Starts a dev server in namespacedefaultwith the supplied options.static TemporalDevServerstart(String namespace, TemporalDevServerOptions options) Starts a dev server for the supplied namespace and options.
-
Method Details
-
start
Starts a dev server in namespacedefaultwith default options. -
start
Starts a dev server in namespacedefaultwith the supplied options. -
start
public static TemporalDevServer start(@Nonnull String namespace, @Nonnull TemporalDevServerOptions options) Starts a dev server for the supplied namespace and options. -
getTarget
Returns the usablehost:portgRPC target. -
getNamespace
Returns the namespace created by the dev server. -
close
public void close()Stops the owned process. This method is idempotent.- Specified by:
closein interfaceAutoCloseable
-