Testing asynchronous Observable instances with the help of the TestScheduler class

There is one last type of predefined scheduler that we didn't mention in Chapter 6, Using Concurrency and Parallelism with Schedulers. This is the TestScheduler scheduler, a scheduler designed to be used in unit tests. All the actions scheduled on it are wrapped in objects containing the time they should be executed at, and won't be executed before the triggerActions() method of the Scheduler instance is called. This method executes all of the actions that are not executed and are scheduled to be executed at or before the Scheduler instance's present time. This time is virtual. This means that it is set by us and we can advance to any moment in the future using ...

Get Learning Reactive Programming with Java 8 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.