So now we've come quite a long way in our test journey.
We covered core concepts of Unit testing, those
foundations we saw in the first section.
We also created a project to work with
which could use JUnit and learned all
about JUnit's API and operation.
So let's take it to the next level
now and laws and more advanced concepts.
First up, we're going to look at Hamcrest.
This is a powerful assertions library
that comes shipped with JUnit.
It allows you to write very easy to read assertions.
To step your assertions up to second gear,
we're also going to introduce you to Mock
Objects thing and take a look at Mockita, the most
popular framework on the java scene currently.
For now, we've just seen basic tests which
will test things in a functional way.
So here's a method or test object, give
it some input parameters or fields invoke a
test method, and then check the results.
Now if you have objects which
interact with each other though. So for
example, Object A calls out to Object B, then
you're going to want to control the way of testing
this. And this is what Mock Objects are all about.
That's going to be fun.
Finally, we'll touch upon code coverage too.
It's an important benchmark the Dev teams like to
use as a measure of code quality, so it's
useful to have a run through of that and
see it in action so you can pass those
quality gates at the end of your development pieces.
So let's jump in now and dig into
the more advanced side of Unit testing.