Test

zio.test.TestClock.Test
final case class Test(clockState: Atomic[Data], live: Live, annotations: Annotations, warningState: Synchronized[WarningData], suspendedWarningState: Synchronized[SuspendedWarningData]) extends TestClock, TestClockPlatformSpecific

Attributes

Graph
Supertypes
trait Product
trait Equals
trait TestClock
trait Restorable
trait Clock
trait Serializable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

trait UnsafeAPI

Attributes

Inherited from:
Clock
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def adjust(duration: Duration)(implicit trace: Trace): UIO[Unit]

Increments the current clock time by the specified duration. Any effects that were scheduled to occur on or before the new time will be run in order.

Increments the current clock time by the specified duration. Any effects that were scheduled to occur on or before the new time will be run in order.

Attributes

def adjustWith[R, E, A](duration: Duration)(zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Increments the current clock time by the specified duration. Any effects that were scheduled to occur on or before the new time will be run in order.

Increments the current clock time by the specified duration. Any effects that were scheduled to occur on or before the new time will be run in order.

Attributes

def currentDateTime(implicit trace: Trace): UIO[OffsetDateTime]

Returns the current clock time as an OffsetDateTime.

Returns the current clock time as an OffsetDateTime.

Attributes

def currentTime(unit: => TimeUnit)(implicit trace: Trace): UIO[Long]

Returns the current clock time in the specified time unit.

Returns the current clock time in the specified time unit.

Attributes

def currentTime(unit: => ChronoUnit)(implicit trace: Trace, d: DummyImplicit): UIO[Long]
def instant(implicit trace: Trace): UIO[Instant]

Returns the current clock time as an Instant.

Returns the current clock time as an Instant.

Attributes

def javaClock(implicit trace: Trace): UIO[Clock]

Constructs a java.time.Clock backed by the Clock service.

Constructs a java.time.Clock backed by the Clock service.

Attributes

def localDateTime(implicit trace: Trace): UIO[LocalDateTime]

Returns the current clock time as a LocalDateTime.

Returns the current clock time as a LocalDateTime.

Attributes

def nanoTime(implicit trace: Trace): UIO[Long]

Returns the current clock time in nanoseconds.

Returns the current clock time in nanoseconds.

Attributes

def save(implicit trace: Trace): UIO[UIO[Unit]]

Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

Attributes

def setTime(instant: Instant)(implicit trace: Trace): UIO[Unit]

Sets the current clock time to the specified Instant. Any effects that were scheduled to occur on or before the new time will be run in order.

Sets the current clock time to the specified Instant. Any effects that were scheduled to occur on or before the new time will be run in order.

Attributes

def setTimeZone(zone: ZoneId)(implicit trace: Trace): UIO[Unit]

Sets the time zone to the specified time zone. The clock time in terms of nanoseconds since the epoch will not be adjusted and no scheduled effects will be run as a result of this method.

Sets the time zone to the specified time zone. The clock time in terms of nanoseconds since the epoch will not be adjusted and no scheduled effects will be run as a result of this method.

Attributes

def sleep(duration: => Duration)(implicit trace: Trace): UIO[Unit]

Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration. Once the clock time is adjusted to on or after the duration, the fiber will automatically be resumed.

Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration. Once the clock time is adjusted to on or after the duration, the fiber will automatically be resumed.

Attributes

def sleeps(implicit trace: Trace): UIO[List[Instant]]

Returns a list of the times at which all queued effects are scheduled to resume.

Returns a list of the times at which all queued effects are scheduled to resume.

Attributes

def supervisedFibers(implicit trace: Trace): UIO[SortedSet[Runtime[Any, Any]]]

Returns a set of all fibers in this test.

Returns a set of all fibers in this test.

Attributes

def timeZone(implicit trace: Trace): UIO[ZoneId]

Returns the time zone.

Returns the time zone.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def scheduler(implicit trace: Trace): UIO[Scheduler]

Attributes

Inherited from:
TestClockPlatformSpecific

Concrete fields

override val unsafe: UnsafeAPI