Uncover the mechanics of JUnit, Mockito, and Hamcrest to transform the way you test your Java projects
Key Features
- Find out why JUnit is the best framework for writing unit tests
- Get hands-on exercises of JUnit and Mockito in action
- Get to grips with modern unit testing concepts and best practices
Book Description
Are you looking for a simple, no-nonsense guide to learning how unit testing works? This video course is what you need. Complete with hands-on exercises and best practices, this guide will help you to understand JUnit and Mockito unit testing with ease.
The course starts with an introduction to unit testing and highlights the need and importance of its testing framework, JUnit. You'll then understand the project structure and conventions by creating a Java project using JUnit. As you implement best practices for writing and running unit tests with JUnit and IntelliJ IDEA, you'll discover how JUnit works. You'll also write mock objects-based unit tests with Mockito for testing a simple layered architecture. Finally, you'll learn to make more powerful assertions in your unit tests by harnessing the power of the Hamcrest assertions library that ships with JUnit.
By the end of this course, you'll have developed the skills needed for writing better unit tests using JUnit, Mockito, and Hamcrest.
"All the resources and support files are available at https://github.com/PacktPublishing/JUnit-and-Mockito-Unit-Testing-for-Java-Developers
What you will learn
- Understand modern unit testing concepts and best practices
- Find out how to run unit tests in the IDE
- Analyze production code for writing quality unit tests
- Study and implement JUnit s fail fast mechanism
- Become familiar with Mockito and mock objects
- Compose Hamcrest matchers to create readable assertions
Who this book is for
Whether you are a Java developer or a tester who wants to write unit tests using JUnit, Mockito, and Hamcrest, this course is for you. A basic understanding of Java is necessary to get started with this course.