RecoverMethods

org.scalatest.RecoverMethods
See theRecoverMethods companion trait

Companion object that facilitates the importing of RecoverMethods's method as an alternative to mixing it in. One use case is to import RecoverMethods's method so you can use it in the Scala interpreter.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def recoverToExceptionIf[T <: AnyRef](future: Future[Any])(implicit classTag: ClassTag[T], exCtx: ExecutionContext, pos: Position): Future[T]

Transforms a future of any type into a Future[T], where T is a given expected exception type, which succeeds if the given future completes with a Failure containing the specified exception type.

Transforms a future of any type into a Future[T], where T is a given expected exception type, which succeeds if the given future completes with a Failure containing the specified exception type.

See the main documentation for this trait for more detail and examples.

Value parameters

future

A future of any type, which you expect to fail with an exception of the specified type T

Attributes

Returns

a Future[T] containing on success the expected exception, or containing on failure a TestFailedException

Inherited from:
RecoverMethods
def recoverToSucceededIf[T <: AnyRef](future: Future[Any])(implicit classTag: ClassTag[T], exCtx: ExecutionContext, pos: Position): Future[Assertion]

Transforms a future of any type into a Future[Assertion] that succeeds if the future completes with a Failure containing the specified exception type.

Transforms a future of any type into a Future[Assertion] that succeeds if the future completes with a Failure containing the specified exception type.

See the main documentation for this trait for more detail and examples.

Value parameters

future

A future of any type, which you expect to fail with an exception of the specified type T

Attributes

Returns

a Future[Assertion] containing on success the Succeeded singleton, or containing on failure a TestFailedException

Inherited from:
RecoverMethods