expectError

As discussed throughout this book, a Reactive Stream terminates with a completion or error event. Similarly to expectComplete, for a completion event, there is the expectError API to validate error events. The expectError API offers the following convenient methods to validate an error message or the exception class:

Error name Description
 expectError() The API only validates the occurrence of an error event. It does not validate any details about the error.
expectError(exceptionClass) The API validates the underlying exception class wrapped in the error event.
expectErrorMessage(errorMessage) The API validates the underlying exception message wrapped in the error event.
expectError(Predicate) The API validates the ...

Get Hands-On Reactive Programming with Reactor now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.