Chapter 16. Test Driving an RxJava Application

In this chapter, we work through an example of test driving an implementation. We’re going to implement a class that polls for new messages on a user’s Squawker timeline and then hands them off to another component for processing. We could use this as the core of a simple command-line client, a desktop GUI application, or a websocket-based browser application.

For the implementation we’ll use RxJava.

Before starting, let’s consider what we mean by “test-driven development” and what a test-driven development (TDD) workflow looks like.

Rather than trying to implement the entire solution at once, either before or after its tests, we’ll work iteratively. Each iteration involves deciding on a feature or behavior to implement next, writing a failing test, implementing the ...

Get Spock: Up and Running 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.