Testing with StepVerifier
In this module, you’re going to learn:
- Set up reactor-test in your project
- How to use
StepVerifier
to test a reactive sequence - How to test errors
- How to use assertions
- How to test the context
- How to test time-based operators
- How to test control flow scenario with
PublisherProbe
- How to use a custom publisher in tests with
TestPublisher
You can find the code for this module here.
Links
- StepVerifier
- StepVerifier.Step
- StepVerifier.FirstStep
- StepVerifier.LastStep
- StepVerifier.Assertions
- StepVerifier.ContextExpectations
- StepVerifierOptions
- VirtualTimeScheduler
- PublisherProbe
- TestPublisher
- TestPublisher.Violation
- Javadoc for Mono
- Javadoc for Flux
Table of contents
- Setting up Tests
- Testing a Reactive Sequence with StepVerifier
- Testing for Errors
- Using Assertions
- Testing the Context
- Testing Time-based Operators
- Testing Control Flow with PublisherProbe
- Using Custom Publishers in Tests with TestPublisher
- Coding Exercises