JUnit and Mockito Unit Testing for Java Developers

Learn how to use JUnit to unit test Java applications using JUnit and Mockito

What's Inside

Do you want to get hands on demonstrations of JUnit and Mockito in action, want a simple no-fluff guide to how unit testing works including getting an understanding of best practices along the way?

Are you struggling to understand unit testing and would like a friendly guide to help you understand it all completely from the ground up?

Maybe you're a junior Java developer who is just starting out and you need a hands-on guide to JUnit and Mockito unit testing to get up and running quickly?

Or you might be an old hand at Java who has been out of practice and needs to level up your unit testing and JUnit and Mockito knowledge ready for a new project?

Then this course is for you!

We cover the following themes:

  • Foundations - this is all the good stuff that's been distilled down through the years - it's best practices and gets you up and running with knowing the stuff the APIs don't tell you
  • Installation and Set Up / Project Creation - we get you creating a project which uses JUnit and introduce you to the project structure and conventions you need to know
  • Writing Tests with JUnit - we cover exactly how to write unit tests with JUnit in this section and get a feel for the API together, covering best practices and how JUnit works along the way
  • Writing mock objects based unit tests with Mockito - we cover a quick start on getting up and running with Mockito to test a simple layered architecture you might find in a webapp (also coding the presentation, business and data layers in preparation to demonstrate this too!) then we demonstrate using Mockito to write tests for it

And the following topics:

  • Arrange/Act/Assert
  • Assertions
  • Testing Conventions
  • Good test characteristics
  • Java project structure
  • Creating a JUnit project with Maven
  • Running unit tests in the IDE
  • Test failures
  • JUnit's fail fast mechanism
  • JUnit's annotations
  • Test fixtures
  • Mock objects and their use in unit testing
  • Mockito basics
  • Layered architecture principles
  • Testing a simple layered architecture with Mockito and JUnit

It's a beginners course, although has some useful content for those already familiar with JUnit, Mockito and unit testing. But to get maximum value from the course, you should really be a beginner. Maybe you've started a new job where they use it to test their applications, or you're learning industry-standard tools to better place you ahead of the competition.

Ultimately, by unlocking the mechanics of how JUnit and Mockito work in front of your eyes, you should be able to better test your Java projects with the frameworks and have fun doing so!

I look forward to teaching you all about JUnit, Mockito and unit testing inside! ;)

Course Curriculum

Get started now!



Certificate Available
34+ Students
61 Lectures
2+ Hours of Video
Lifetime Access
24/7 Support
Instructor Rating
Matt Speake

Matt Speake is a professional software engineer specializing in Java technologies. He has over 20 years experience working everywhere from small startups to large global corporations and is the principal trainer at JavaEasily in the UK. Subscribe to the JavaEasily Youtube channel for more great videos and follow us on Facebook too!

Popular Bundles