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 live online training, plus books, videos, and digital content from nearly 200 publishers.