Autoplay
Autocomplete
Previous Lesson
Complete and Continue
JUnit and Mockito Unit Testing for Java Developers
Unit Testing Foundations
Overview of the Course Structure (1:34)
What is Unit Testing? (2:45)
Introducing a Simple Unit Test in JUnit (3:02)
Structure of a Unit Test (5:08)
Conventions for Writing Unit Tests (2:41)
Characteristics of Proper Unit Tests (5:48)
Creating a Java Project which uses JUnit
01 - Section Introduction (0:49)
Creating a Java project which includes JUnit using the Maven Quickstart Archetype (2:51)
Introducing a typical Java project structure (production vs test source trees) (2:47)
Understanding the basic conventions for creating unit tests (package and naming conventions) (3:42)
01 - Section Introduction (0:36)
Writing and Running Unit Tests with JUnit and IntelliJ IDEA
Section Introduction (0:52)
Creating a test method with the @Test annotation (1:39)
Running a unit test within the IDE and understanding test success (1:21)
Understanding test failures with exceptions (2:21)
Failing a unit test explicitly with Assert.fail (0:45)
Using Assert.fail to check validation logic in a try:catch (2:23)
An introduction to the JUnit Assertions API
Structuring unit tests with Arrange:Act:Assert (2:04)
Understanding execution of assertions and JUnit's fail-fast test failure mechanism (3:28)
Adding descriptive comments to assertions and test failures to aid diagnostics (0:48)
Coding a unit test following Arrange-Act-Assert (1:12)
Keeping test setup DRY with @Before (4:55)
Understanding test fixture instantiation (2:14)
Unit Testing with Mock Objects and Mockito
What is Mockito and what are Mock Objects? (3:58)
Introduction to testing with mock objects (4:56)
Configuring Projects to Use Mockito (2:45)
Creating a project which uses JUnit and Mockito (4:07)
Coding a Layered Architecture - Presentation Layer (3:26)
Coding a Layered Architecture - Business Layer (3:32)
Coding a Layered Architecture - Persistence Layer (4:11)
Putting the correct packages in place to respect the layering (2:44)
Writing a test for the Login Controller in the presentation layer (9:48)
Understanding the test fixture setup when writing mock object based unit tests (1:01)
Writing a test for the Authentication Service in the business layer (3:57)
Thinking about design decisions when unit testing (0:38)
Looking at the Hamcrest Assertions Library
Section Introduction (0:58)
Evolving the Domain and Repository Classes (6:36)
Ignoring Tests with @ignore (4:17)
Implementing a Finder in the Repository (0:57)
Implementing Business Logic in the Service (3:13)
Configuring Maven to use Java 8 (2:32)
Evolving the Repository Class (1:32)
Adding a Parameter-driven Finder to the Service (1:34)
Refactoring to Evolve a New Service (1:16)
Generating Test Methods in the IDE and Toggling Between Production and Test Code (1:26)
Introducing the JUnit Mockito Runner and @Mock (1:04)
Analyzing the Production Code to Determine How to Write the Arrange Section (3:58)
Using Mockito's @InjectMocks to Create the System Under Test with it's Dependencies (1:33)
Keep Yourself Motivated by Checking the Happy Path Test Output (2:06)
Using the JUnit Assertions API to write the Assert Section (5:17)
Thinking About the Weaknesses of the JUnit Assertions API (1:59)
The Importance of Checking Your Work as you Go (2:29)
Upgrading a JUnit project to use the full Hamcrest version (3:11)
Replacing JUnit assertions with Hamcrest assertions and using assertions with collections (2:12)
Understanding and Reading Hamcrest Test Failures (2:46)
Quick thoughts on Hamcrest individual vs collection Assertions (0:29)
Don't invoke unneeded production code in your test classes (1:01)
Understanding Evaluation of Hamcrest Matchers (1:17)
Thinking about why we keep production code to a minimum in tests (1:19)
Creating Complex Hamcrest Assertions with allOf and Property Matchers (4:32)
An introduction to the JUnit Assertions API
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock