Chapter 3Digging Deeper into JUnit Assertions
In the last chapter we worked through a meaty example of writing unit tests against an existing bit of code. You learned how to use assertions to express expected outcomes.
In this chapter you’ll learn many additional ways to phrase asserts in JUnit by using a library known as Hamcrest. You’ll also learn how to write tests when you’re expecting exceptions.