class StubbedZIOMethod0[R] extends StubbedMethod0[R]
Representation of stubbed method without arguments.
ZIOStubs interface provides implicit conversion from selected method to StubbedMethodZIO0.
trait Foo: def foo00(): String def fooIO: IO[String, Int] val foo = stub[Foo]
The default way of getting stub for such method - convert it to a function () => R.
Exclusively for ZIO - you can omit converting it to function
val foo00Stubbed: StubbedMethod0[String] = () => foo.foo00() val fooIOStubbed: StubbedMethod0[IO[String, Int]] = foo.fooIO
- Alphabetic
- By Inheritance
- StubbedZIOMethod0
- StubbedMethod0
- Order
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StubbedZIOMethod0(delegate: StubbedMethod0[R])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asString: String
Returns string representation of method.
Returns string representation of method. Representation currently depends on scala version.
- Definition Classes
- StubbedZIOMethod0 → Order
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
diesWith(f: ⇒ Throwable)(implicit ev: <:<[UIO[Nothing], R]): UIO[Unit]
Allows set die result for method without arguments.
Allows set die result for method without arguments. Returns ZIO.
for { _ <- (() => foo.foo00()).diesWith(new Exception("foo")) _ <- foo.fooIO.diesWith(new Exception("bar")) } yield ()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
failsWith[RR](f: ⇒ RR)(implicit ev: <:<[IO[RR, Nothing], R]): UIO[Unit]
Allows set fail result for method without arguments.
Allows set fail result for method without arguments. Returns ZIO.
for { _ <- (() => foo.foo00()).failsWith("result") _ <- foo.fooIO.failsWith(1) } yield ()
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isAfter(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called after other method.
Returns true if this method was called after other method.
- Definition Classes
- StubbedZIOMethod0 → Order
-
def
isBefore(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called before other method.
Returns true if this method was called before other method.
- Definition Classes
- StubbedZIOMethod0 → Order
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
returnsWith(value: ⇒ R): Unit
Allows to set result for method without arguments.
Allows to set result for method without arguments.
(() => foo.foo00()).returnsWith("result") foo.fooIO.returnsWith(ZIO.succeed(1))
- Definition Classes
- StubbedZIOMethod0 → StubbedMethod0
-
def
returnsZIOWith(value: ⇒ R): UIO[Unit]
Allows to set result for method without arguments.
Allows to set result for method without arguments. Returns ZIO.
for { _ <- (() => foo.foo00()).returnsZIOWith("result") _ <- foo.fooIO.returnsZIOWith(ZIO.succeed(1)) } yield ()
-
def
succeedsWith[RR](f: ⇒ RR)(implicit ev: <:<[IO[Nothing, RR], R]): UIO[Unit]
Allows to set success for method without arguments.
Allows to set success for method without arguments. Returns ZIO.
for { _ <- (() => foo.foo00()).succeedsWith("result") _ <- foo.fooIO.succeedsWith(1) } yield ()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
times: Int
Allows to get number of times method was executed.
Allows to get number of times method was executed.
for { _ <- foo.fooIO.returnsZIO(ZIO.succeed(1)) _ <- foo.fooIO.repeatN(10) } yield foo.fooIO.times == 11 // true
- Definition Classes
- StubbedZIOMethod0 → StubbedMethod0
-
def
timesZIO: UIO[Int]
Allows to get number of times method was executed.
Allows to get number of times method was executed. Returns ZIO
for { _ <- foo.fooIO.returnsZIO(ZIO.succeed(1)) _ <- foo.fooIO.repeatN(10) fooIOTimes <- foo.fooIO.timesZIO } yield fooIOTimes == 11 // true
-
def
toString(): String
- Definition Classes
- StubbedZIOMethod0 → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Deprecated Value Members
-
def
returns(f: ⇒ R): Unit
Allows to set result for method without arguments.
Allows to set result for method without arguments.
(() => foo.foo00()).returns("result") foo.fooIO.returns(ZIO.succeed(1))
- Definition Classes
- StubbedZIOMethod0 → StubbedMethod0
- Annotations
- @deprecated
- Deprecated
Use
returnsWithinstead. Will be deleted in first release after 01.07.2025. This is needed to replace StubbedMethod0[R] with StubbedMethod[Unit, R]
-
def
returnsZIO(f: ⇒ R): UIO[Unit]
Allows to set result for method without arguments.
Allows to set result for method without arguments. Returns ZIO.
for { _ <- (() => foo.foo00()).returnsZIO("result") _ <- foo.fooIO.returnsZIO(ZIO.succeed(1)) } yield ()
- Annotations
- @deprecated
- Deprecated
Use
returnsZIOWith,succeedsWith,failsWith,diesWithinstead. Will be deleted in first release after 01.07.2025. This is needed to replace StubbedMethod0[R] with StubbedMethod[Unit, R]