inject

open fun <SERVICE : Any> inject(service: SERVICE, serviceName: String = service.javaClass.toName(), serviceType: KType = service.javaClass.kotlin.defaultType): WhenStage<T>

Injects a service instance into the test context.

This method registers a service that can be used during saga processing. The service name and type are automatically derived from the service instance but can be overridden if needed.

Return

The current stage for method chaining.

Parameters

SERVICE

The type of the service to inject.

service

The service instance to register.

serviceName

The name to register the service under (defaults to class name).

serviceType

The Kotlin type of the service (defaults to class default type).