public final class TestActivityEnvironmentInternal extends java.lang.Object implements TestActivityEnvironment
Constructor and Description |
---|
TestActivityEnvironmentInternal(TestEnvironmentOptions options) |
Modifier and Type | Method and Description |
---|---|
<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.
|
<T> void |
setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
java.util.function.Consumer<T> listener)
Sets a listener that is called every time an activity implementation heartbeats through
Activity.heartbeat(Object) . |
<T> void |
setActivityHeartbeatListener(java.lang.Class<T> detailsClass,
java.lang.reflect.Type detailsType,
java.util.function.Consumer<T> listener)
Sets a listener that is called every time an activity implementation heartbeats through
Activity.heartbeat(Object) . |
void |
setWorkflowService(IWorkflowService workflowService) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newInstance, newInstance
public 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 TestActivityEnvironment
public <T> T newActivityStub(java.lang.Class<T> activityInterface)
newActivityStub
in interface TestActivityEnvironment
T
- Type of the activity interface.activityInterface
- interface type implemented by activitiespublic <T> void setActivityHeartbeatListener(java.lang.Class<T> detailsClass, java.util.function.Consumer<T> listener)
TestActivityEnvironment
Activity.heartbeat(Object)
.setActivityHeartbeatListener
in interface TestActivityEnvironment
T
- Type of the heartbeat details.detailsClass
- class of the details passed to the Activity.heartbeat(Object)
.listener
- listener to register.public <T> void setActivityHeartbeatListener(java.lang.Class<T> detailsClass, java.lang.reflect.Type detailsType, java.util.function.Consumer<T> listener)
TestActivityEnvironment
Activity.heartbeat(Object)
.setActivityHeartbeatListener
in interface TestActivityEnvironment
T
- Type of the heartbeat details.detailsClass
- class of the details passed to the Activity.heartbeat(Object)
.detailsType
- type of the details. Differs for detailsClass for generic types.listener
- listener to register.public void setWorkflowService(IWorkflowService workflowService)
setWorkflowService
in interface TestActivityEnvironment