Class TemporalDevServer

java.lang.Object
io.temporal.testing.TemporalDevServer
All Implemented Interfaces:
AutoCloseable

@Experimental public final class TemporalDevServer extends Object implements 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 Details

    • start

      public static TemporalDevServer start()
      Starts a dev server in namespace default with default options.
    • start

      public static TemporalDevServer start(@Nonnull TemporalDevServerOptions options)
      Starts a dev server in namespace default with 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

      public String getTarget()
      Returns the usable host:port gRPC target.
    • getNamespace

      public String getNamespace()
      Returns the namespace created by the dev server.
    • close

      public void close()
      Stops the owned process. This method is idempotent.
      Specified by:
      close in interface AutoCloseable