TestProgressSession

class TestProgressSession<F : Failure> @JvmOverloads constructor(script: TestSessionScript<F>, id: UUID = UUID.randomUUID(), initialState: Session.State<F> = Pending, initialProgress: Progress = Progress()) : TestSession<F> , ProgressSession<F>

A controllable ProgressSession test double.

Progress listeners are invoked on the calling thread, and the current progress is delivered immediately when a listener is added. Use controller to drive progress updates alongside state transitions.

Constructors

Link copied to clipboard
constructor(script: TestSessionScript<F>, id: UUID = UUID.randomUUID(), initialState: Session.State<F> = Pending, initialProgress: Progress = Progress())

Properties

Link copied to clipboard

Returns the controller used to drive this session in tests.

Link copied to clipboard
open override val id: UUID
Link copied to clipboard
open override val isActive: Boolean
Link copied to clipboard
open override val isCancelled: Boolean
Link copied to clipboard
open override val isCompleted: Boolean
Link copied to clipboard

Returns the current progress of this session.

Link copied to clipboard

Returns a snapshot of progress updates for this session.

Link copied to clipboard

Returns the current state of this session.

Link copied to clipboard

Returns a snapshot of state transitions for this session.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun cancel()
Link copied to clipboard
open override fun commit(): Boolean
Link copied to clipboard
open override fun launch(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun removeStateListener(listener: Session.StateListener<F>)
Link copied to clipboard
open override fun reset(state: Session.State<F>, notifyListeners: Boolean)

Resets state and state history to the provided state.

Link copied to clipboard
fun resetProgress(progress: Progress = initialProgress, notifyListeners: Boolean = false)

Resets progress and progress history to the provided progress.