public class SDKTestWorkflowRule
extends java.lang.Object
implements org.junit.rules.TestRule
TestWorkflowRule
and provides additional convenience methods for SDK developmentModifier and Type | Class and Description |
---|---|
static class |
SDKTestWorkflowRule.Builder |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE |
static boolean |
REGENERATE_JSON_FILES |
static java.lang.String |
temporalServiceAddress |
static boolean |
useExternalService |
static java.lang.String |
UUID_REGEXP |
Modifier and Type | Method and Description |
---|---|
<R> void |
addWorkflowImplementationFactory(java.lang.Class<R> factoryImpl,
io.temporal.workflow.Functions.Func<R> factoryFunc) |
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
void |
assertHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution,
io.temporal.api.enums.v1.EventType eventType)
Asserts that an event of the given EventType is found in the history.
|
void |
assertNoHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution,
io.temporal.api.enums.v1.EventType eventType)
Asserts that an event of the given EventType is not found in the history.
|
io.temporal.internal.common.WorkflowExecutionHistory |
getExecutionHistory(io.temporal.api.common.v1.WorkflowExecution execution) |
io.temporal.api.history.v1.History |
getHistory(io.temporal.api.common.v1.WorkflowExecution execution) |
io.temporal.api.history.v1.HistoryEvent |
getHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution,
io.temporal.api.enums.v1.EventType eventType)
Returns the first event of the given EventType found in the history.
|
java.util.List<io.temporal.api.history.v1.HistoryEvent> |
getHistoryEvents(io.temporal.api.common.v1.WorkflowExecution execution,
io.temporal.api.enums.v1.EventType eventType)
Returns list of all events of the given EventType found in the history.
|
<T extends io.temporal.common.interceptors.WorkerInterceptor> |
getInterceptor(java.lang.Class<T> type) |
java.lang.String |
getTaskQueue() |
TestWorkflowEnvironment |
getTestEnvironment() |
io.temporal.worker.Worker |
getWorker() |
io.temporal.client.WorkflowClient |
getWorkflowClient() |
boolean |
isUseExternalService() |
static SDKTestWorkflowRule.Builder |
newBuilder() |
io.temporal.client.WorkflowStub |
newUntypedWorkflowStub(java.lang.String workflow) |
io.temporal.client.WorkflowStub |
newUntypedWorkflowStubTimeoutOptions(java.lang.String workflow) |
<T> T |
newWorkflowStub(java.lang.Class<T> workflow) |
<T> T |
newWorkflowStub200sTimeoutOptions(java.lang.Class<T> workflow) |
<T> T |
newWorkflowStubTimeoutOptions(java.lang.Class<T> workflow) |
void |
regenerateHistoryForReplay(io.temporal.api.common.v1.WorkflowExecution execution,
java.lang.String fileName) |
void |
registerDelayedCallback(java.time.Duration delay,
java.lang.Runnable r) |
protected void |
shutdown() |
void |
sleep(java.time.Duration d) |
static void |
waitForOKQuery(io.temporal.client.WorkflowStub stub)
Used to ensure that workflow first workflow task is executed.
|
public static final java.lang.String NAMESPACE
public static final java.lang.String UUID_REGEXP
public static final boolean REGENERATE_JSON_FILES
public static final boolean useExternalService
public static final java.lang.String temporalServiceAddress
public static SDKTestWorkflowRule.Builder newBuilder()
public org.junit.runners.model.Statement apply(@Nonnull org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
public <T extends io.temporal.common.interceptors.WorkerInterceptor> T getInterceptor(java.lang.Class<T> type)
public java.lang.String getTaskQueue()
public io.temporal.worker.Worker getWorker()
public io.temporal.api.history.v1.History getHistory(io.temporal.api.common.v1.WorkflowExecution execution)
public io.temporal.internal.common.WorkflowExecutionHistory getExecutionHistory(io.temporal.api.common.v1.WorkflowExecution execution)
public java.util.List<io.temporal.api.history.v1.HistoryEvent> getHistoryEvents(io.temporal.api.common.v1.WorkflowExecution execution, io.temporal.api.enums.v1.EventType eventType)
public io.temporal.api.history.v1.HistoryEvent getHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution, io.temporal.api.enums.v1.EventType eventType)
public void assertHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution, io.temporal.api.enums.v1.EventType eventType)
public void assertNoHistoryEvent(io.temporal.api.common.v1.WorkflowExecution execution, io.temporal.api.enums.v1.EventType eventType)
public io.temporal.client.WorkflowClient getWorkflowClient()
public boolean isUseExternalService()
public TestWorkflowEnvironment getTestEnvironment()
public <T> T newWorkflowStub(java.lang.Class<T> workflow)
public <T> T newWorkflowStubTimeoutOptions(java.lang.Class<T> workflow)
public <T> T newWorkflowStub200sTimeoutOptions(java.lang.Class<T> workflow)
public io.temporal.client.WorkflowStub newUntypedWorkflowStub(java.lang.String workflow)
public io.temporal.client.WorkflowStub newUntypedWorkflowStubTimeoutOptions(java.lang.String workflow)
public static void waitForOKQuery(io.temporal.client.WorkflowStub stub)
public <R> void addWorkflowImplementationFactory(java.lang.Class<R> factoryImpl, io.temporal.workflow.Functions.Func<R> factoryFunc)
public void regenerateHistoryForReplay(io.temporal.api.common.v1.WorkflowExecution execution, java.lang.String fileName)
public void registerDelayedCallback(java.time.Duration delay, java.lang.Runnable r)
protected void shutdown() throws java.lang.Throwable
java.lang.Throwable
public void sleep(java.time.Duration d)