Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Unit Testing in Java!
You have completed Unit Testing in Java!
Preview
JUnit tests have several hooks that allow you to run before and after each test method. Let's explore!
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
In order to fully understand the way to
fix this don't repeat yourself problem.
0:01
I first want to make sure that we
understand more or less what has happened.
0:06
First of all,
0:10
these classes that contain the methods
marked with Test are called fixtures.
0:11
They have some hidden powers that
we haven't talked about yet.
0:16
When you kick off the Test runner,
what happens is that each method
0:19
that is annotated with the @Test
annotation is gathered.
0:22
[SOUND] The runner then
loops through each test.
0:25
And for each test that it instantiates,
it creates a brand new object and
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up