Chapter 1Building Your First JUnit Test

In this chapter we’ll work through a small example of writing a unit test. You’ll learn how to set up your project and how to add a test class, and you’ll see what a test method looks like. Most important, you’ll learn how to get JUnit to run your new, passing test.

Get Pragmatic Unit Testing in Java 8 with JUnit 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.