public final class TestActivityEnvironmentInternal extends java.lang.Object implements TestActivityEnvironment
| Constructor and Description |
|---|
TestActivityEnvironmentInternal(TestEnvironmentOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<T> T |
newActivityStub(java.lang.Class<T> activityInterface)
Creates client stub to activities that implement given interface.
|
void |
registerActivitiesImplementations(java.lang.Object... activityImplementations)
Register activity implementation objects with a worker.
|
void |
requestCancelActivity()
Requests activity cancellation.
|
<T> void |
setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
io.temporal.workflow.Functions.Proc1<T> listener)
Sets a listener that is called every time an activity implementation heartbeats through
ActivityExecutionContext.heartbeat(Object). |
<T> void |
setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
java.lang.reflect.Type detailsType,
io.temporal.workflow.Functions.Proc1<T> listener)
Sets a listener that is called every time an activity implementation heartbeats through
ActivityExecutionContext.heartbeat(Object). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewInstance, newInstancepublic TestActivityEnvironmentInternal(TestEnvironmentOptions options)
public void registerActivitiesImplementations(java.lang.Object... activityImplementations)
Implementations that share a worker must implement different interfaces as an activity type is identified by the activity interface, not by the implementation.
registerActivitiesImplementations in interface TestActivityEnvironmentpublic <T> T newActivityStub(java.lang.Class<T> activityInterface)
newActivityStub in interface TestActivityEnvironmentT - Type of the activity interface.activityInterface - interface type implemented by activitiespublic void requestCancelActivity()
TestActivityEnvironmentrequestCancelActivity in interface TestActivityEnvironmentpublic <T> void setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
io.temporal.workflow.Functions.Proc1<T> listener)
TestActivityEnvironmentActivityExecutionContext.heartbeat(Object).setActivityHeartbeatListener in interface TestActivityEnvironmentT - Type of the heartbeat details.detailsClass - class of the details passed to the ActivityExecutionContext.heartbeat(Object).listener - listener to register.public <T> void setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
java.lang.reflect.Type detailsType,
io.temporal.workflow.Functions.Proc1<T> listener)
TestActivityEnvironmentActivityExecutionContext.heartbeat(Object).setActivityHeartbeatListener in interface TestActivityEnvironmentT - Type of the heartbeat details.detailsClass - class of the details passed to the ActivityExecutionContext.heartbeat(Object).detailsType - type of the details. Differs for detailsClass for generic types.listener - listener to register.public void close()
close in interface TestActivityEnvironment