Class InProcessGRPCServer

java.lang.Object
io.temporal.internal.testservice.InProcessGRPCServer

public class InProcessGRPCServer extends Object
Generates an in-process service and the channel for it. Useful for testing, usually with mock and spy services.
  • Constructor Details

    • InProcessGRPCServer

      public InProcessGRPCServer(Collection<io.grpc.BindableService> services)
      Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them. Also provides a channel to access the created server, see getChannel()
      Parameters:
      services - implementations of the gRPC services. For example, one of them can be an instance extending WorkflowServiceGrpc.WorkflowServiceImplBase
    • InProcessGRPCServer

      public InProcessGRPCServer(Collection<io.grpc.BindableService> services, boolean createChannel)
      Register the passed services in a new in-memory gRPC service with health service providing SERVING status for all of them.
      Parameters:
      services - implementations of the gRPC services. For example, one of them can be an instance extending WorkflowServiceGrpc.WorkflowServiceImplBase
      createChannel - defines if a channel to access the created server should be created. If true, the created channel will be accessible using getChannel()
  • Method Details

    • shutdown

      public void shutdown()
    • shutdownNow

      public void shutdownNow()
    • isShutdown

      public boolean isShutdown()
    • isTerminated

      public boolean isTerminated()
    • awaitTermination

      public boolean awaitTermination(long timeout, TimeUnit unit)
    • getServer

      public io.grpc.Server getServer()
    • getChannel

      @Nullable public io.grpc.ManagedChannel getChannel()