O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving to Multiples

The commits through [4bdedba] proceed to the handling of multiple URLs to be retrieved. At this point, I only handle direct retrieval with no modifiers, so the easiest approach was to create a new entry point that accepted multiple URLs and looped, invoking the existing retrieve() method for each. This required some elaboration of the spec for how multiple bodies of content should be displayed successively.

The driving test for this functionality was written in [5334caa]. This test creates a stub that uses a counter to return different content for each invocation. Different returns help to insulate the test from the accidental appearance of correctness.

Some would object to the use of StringUtils.join() both in the test and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required