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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.