ZTestActivityEnvironment

zio.temporal.testkit.ZTestActivityEnvironment
See theZTestActivityEnvironment companion object

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addActivityImplementation[A <: AnyRef : ExtendsActivity](activity: A): UIO[Unit]

Registers activity implementations to test. Use newActivityStub to create stubs that can be used to invoke them.

Registers activity implementations to test. Use newActivityStub to create stubs that can be used to invoke them.

Implementations that share a worker must implement different interfaces as an activity type is identified by the activity interface, not by the implementation.

Attributes

Throws
TypeAlreadyRegisteredException

if one of the activity types is already registered

def addActivityImplementationService[A <: AnyRef : Tag]: URIO[A, Unit]

Registers activity implementations to test. Use newActivityStub to create stubs that can be used to invoke them.

Registers activity implementations to test. Use newActivityStub to create stubs that can be used to invoke them.

Implementations that share a worker must implement different interfaces as an activity type is identified by the activity interface, not by the implementation.

Attributes

Throws
TypeAlreadyRegisteredException

if one of the activity types is already registered

def newActivityStub[A <: AnyRef : ClassTag](options: ZActivityOptions): UIO[A]

Creates a stub that can be used to invoke activities registered through addActivityImplementation

Creates a stub that can be used to invoke activities registered through addActivityImplementation

Type parameters

A

Type of the activity interface.

Value parameters

options

activity options

Attributes

Returns

The stub builder for the activity.

Note

it's not a zio.temporal.activity.ZActivityStub because the activity is invoked locally. Wrapping method invocation into zio.temporal.activity.ZActivityStub.execute is not required

def requestCancelActivity(): UIO[Unit]

Requests activity cancellation. The cancellation is going to be delivered to the activity on the next heartbeat.

Requests activity cancellation. The cancellation is going to be delivered to the activity on the next heartbeat.

Attributes

def setActivityHeartbeatListener[T : JavaTypeTag](listener: T => Unit): UIO[Unit]

Sets a listener that is called every time an activity implementation heartbeats through zio.temporal.activity.ZActivityExecutionContext.heartbeat

Sets a listener that is called every time an activity implementation heartbeats through zio.temporal.activity.ZActivityExecutionContext.heartbeat

Type parameters

T

type of the details passed to the zio.temporal.activity.ZActivityExecutionContext.heartbeat

Value parameters

listener

listener to register.

Attributes

def setHeartbeatDetails[T](details: T): UIO[Unit]

Sets heartbeat details for the next activity execution. The next activity called from this TestActivityEnvironment will be able to access this value using zio.temporal.activity.ZActivityExecutionContext.heartbeat. This value is cleared upon execution.

Sets heartbeat details for the next activity execution. The next activity called from this TestActivityEnvironment will be able to access this value using zio.temporal.activity.ZActivityExecutionContext.heartbeat. This value is cleared upon execution.

Type parameters

T

Type of the heartbeat details.

Value parameters

details

The details object to make available to the next activity call.

Attributes

Deprecated methods

def newActivityStub[A <: AnyRef : ClassTag]: ZActivityStubBuilderInitial[UIO[A]]

Creates a stub that can be used to invoke activities registered through addActivityImplementation

Creates a stub that can be used to invoke activities registered through addActivityImplementation

Type parameters

A

Type of the activity interface.

Attributes

Returns

The stub builder for the activity.

Note

it's not a zio.temporal.activity.ZActivityStub because the activity is invoked locally. Wrapping method invocation into zio.temporal.activity.ZActivityStub.execute is not required

Deprecated
[Since version 0.6.0]

Concrete fields

val toJava: TestActivityEnvironment

Implicits

Implicits

implicit lazy val activityRunOptions: ZActivityRunOptions[R]