public static class TestWorkflowRule.Builder
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
TestWorkflowRule |
build() |
TestWorkflowRule.Builder |
setActivityImplementations(java.lang.Object... activityImplementations) |
TestWorkflowRule.Builder |
setDoNotStart(boolean doNotStart)
When set to true the
TestWorkflowEnvironment.start() is not called by the rule before
executing the test. |
TestWorkflowRule.Builder |
setInitialTime(java.time.Instant initialTime)
Set the initial time for the workflow virtual clock.
|
TestWorkflowRule.Builder |
setInitialTimeMillis(long initialTimeMillis)
Set the initial time for the workflow virtual clock, milliseconds since epoch.
|
TestWorkflowRule.Builder |
setNamespace(java.lang.String namespace) |
TestWorkflowRule.Builder |
setTarget(java.lang.String target)
Optional parameter that defines an endpoint which will be used for the communication with
standalone temporal service.
|
TestWorkflowRule.Builder |
setTestTimeoutSeconds(long testTimeoutSeconds)
Deprecated.
Temporal test rule shouldn't be responsible for enforcing test timeouts. Use
toolchain of your test framework to enforce timeouts.
|
TestWorkflowRule.Builder |
setUseExternalService(boolean useExternalService)
Switches between in-memory and external temporal service implementations.
|
TestWorkflowRule.Builder |
setWorkerFactoryOptions(io.temporal.worker.WorkerFactoryOptions options) |
TestWorkflowRule.Builder |
setWorkerOptions(io.temporal.worker.WorkerOptions options) |
TestWorkflowRule.Builder |
setWorkflowClientOptions(io.temporal.client.WorkflowClientOptions workflowClientOptions)
Override
WorkflowClientOptions for test environment. |
TestWorkflowRule.Builder |
setWorkflowTypes(java.lang.Class<?>... workflowTypes) |
TestWorkflowRule.Builder |
setWorkflowTypes(io.temporal.worker.WorkflowImplementationOptions implementationOptions,
java.lang.Class<?>... workflowTypes) |
public TestWorkflowRule.Builder setWorkerOptions(io.temporal.worker.WorkerOptions options)
public TestWorkflowRule.Builder setWorkerFactoryOptions(io.temporal.worker.WorkerFactoryOptions options)
public TestWorkflowRule.Builder setWorkflowClientOptions(io.temporal.client.WorkflowClientOptions workflowClientOptions)
WorkflowClientOptions
for test environment. If set, takes precedence over
namespace
.public TestWorkflowRule.Builder setNamespace(java.lang.String namespace)
public TestWorkflowRule.Builder setWorkflowTypes(java.lang.Class<?>... workflowTypes)
public TestWorkflowRule.Builder setWorkflowTypes(io.temporal.worker.WorkflowImplementationOptions implementationOptions, java.lang.Class<?>... workflowTypes)
public TestWorkflowRule.Builder setActivityImplementations(java.lang.Object... activityImplementations)
public TestWorkflowRule.Builder setUseExternalService(boolean useExternalService)
useExternalService
- use external service if true.
Default is false.
public TestWorkflowRule.Builder setTarget(java.lang.String target)
setUseExternalService(boolean)
is set
to false.
Default is to use 127.0.0.1:7233
@Deprecated public TestWorkflowRule.Builder setTestTimeoutSeconds(long testTimeoutSeconds)
public TestWorkflowRule.Builder setInitialTimeMillis(long initialTimeMillis)
Default is current time
public TestWorkflowRule.Builder setInitialTime(java.time.Instant initialTime)
Default is current time
public TestWorkflowRule.Builder setDoNotStart(boolean doNotStart)
TestWorkflowEnvironment.start()
is not called by the rule before
executing the test. This to support tests that register activities and workflows with workers
directly instead of using only TestWorkflowRule.Builder
.public TestWorkflowRule build()