O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mockito Tutorial : Learn mocking with 25 Junit Examples

Video Description

Learn unit testing and mocking with 25 Junit Examples

About This Video

  • The course has a very good explanatory video provided by the author.
  • The course shows code while explaining the concepts

In Detail

Writing great unit tests distinguishes good programmers from great programmers. In this course, you will learn how to write great unit tests with Mockito and JUnit. You take 12 steps with JUnit and 18 steps with Mockito into unit testing proficiency.

Table of Contents

  1. Chapter 1 : Introduction
    1. Introduction 00:02:18
    2. Three thing you need to know 00:01:45
  2. Chapter 2 : Unit Testing with Junit
    1. JUnit Step 1: Why is Unit Testing Important? 00:03:41
    2. JUnit Step 2: Setting up your first Junit 00:08:05
    3. Step 03: First Successful JUnit. Green Bar and assertEquals 00:09:39
    4. Step 04: Refactoring Your First JUnit Test 00:07:44
    5. Step 05: Second JUnit Example assertTrue and assertFalse 00:14:45
    6. Step 06: @Before @After 00:07:02
    7. Step 07: @BeforeClass @AfterClass 00:03:30
    8. Step 08: Comparing Arrays in JUnit Tests 00:05:19
    9. Step 09: Testing Exceptions in JUnit Tests 00:03:33
    10. Step 10: Testing Performance in JUnit Tests 00:04:03
    11. Step 11: Parameterized Tests 00:11:11
    12. Step 12: Organize JUnits into Suites 00:03:24
  3. Chapter 3 : Getting Ready for Mockito
    1. An Overview 00:01:53
    2. Mockito Step 01: Setting up a Maven Project 00:07:31
  4. Chapter 4 : Need For Mockito
    1. Overview of this Section 00:02:10
    2. Mockito Step 02: Setting up SUT (System Under Test) 00:11:02
    3. Step 03: Stubbing Example - with Disadvantages of Stubbing 00:11:43
    4. Step 04: Your first Mockito code! Hurrah!!! 00:18:54
  5. Chapter 5 : Mockito Basics
    1. Basics of Mockito - Section Overview 00:01:05
    2. Step 05: Stubbing variations with Mockito - Argument Matchers & More... 00:13:04
    3. Step 06: BDD Style - Given When Then 00:13:28
    4. Step 07: Verify calls on Mocks 00:08:52
    5. Step 08: Capturing arguments passed to a Mock 00:08:43
  6. Chapter 6 : Mockito Advanced
    1. Step 09: Hamcrest Matchers 00:11:41
    2. Step 10: Mockito Annotations - @Mock, @InjectMocks, @RunWith, @Captor.. 00:10:00
    3. Step 11: Mockito Junit Rule 00:03:40
    4. Step 12: Real world Mockito Example with Spring 00:16:08
    5. Step 13: Mockito Spy 00:10:03
    6. Step 14: Theory: Why does Mockito not allow stubbing final & private methods? 00:04:25
  7. Chapter 7 : Powermock with Mockito
    1. Step 15: Setting up PowerMock and SystemUnderTest 00:08:37
    2. Step 15: Continued. Mocking Static Method 00:12:31
    3. Step 16: Invoking Private Methods 00:05:43
    4. Step 17: Mocking a Constructor 00:09:25
    5. Step 18: Writing Good Unit Tests 00:07:22