4.33 out of 5
4.33
1453 reviews on Udemy

Learn Unit Testing with Junit & Mockito in 30 Steps

Learn Mockito and JUnit - the most popular unit testing and mocking frameworks - with 25 Examples
Instructor:
in28Minutes Official
9,646 students enrolled
English [Auto-generated]
You will Understand the Basics of Unit Testing with JUnit
You will Learn the Most Popular Mocking Framework - Mockito
You will Learn to Write Great Unit Tests using Mocking
You will Learn to Use Mockito in combination with Junit and PowerMock

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.

******* Some Amazing Reviews From Our Learners *******

★★★★★ When I’ve started this course I had very basic knowledge of JUnit and Mockito and now everything is clearer. It is a very good course for beginners. Everything was very well explained. 

★★★★★ As always, Ranga offers an excellent way of teaching: coding from scratch, good explanation, useful examples for the real world job. He is not only an experienced programmer, but also a great teacher. I learned more than I expected. Thanks

★★★★★ It was my long time wish to learn Mockito and this instructor nailed it. Best 5hrs I spent ever. He is really good in what he is doing. 

★★★★★ This course is a great tutorial to unit testing and standard practices of mocking. I would recommend it to even experienced developers who would be surprised to find some new ideas in here. Explanations are precise and detailed. Well done.

★★★★★ Very interesting course with good examples. Every topic was easy to understand because of author’s awesome explanation. I rate this course as 5/5.

★★★★★ Very good course. The approach is very systematic and step by step. I really like the combination of theory and practical goes hand by hand. The journey from JUnit to Mockito to Powermock is very well described.

******* What You Can Expect from Every in28Minutes Course *******

in28Minutes created 20 Best Selling Courses providing Amazing Learning Experiences to 250,000 Learners across the world.

Each of these courses come with

✔ Amazing Hands-on Step By Step Learning Experiences

✔ Real Project Experiences using the Best Tools and Frameworks

✔ Awesome Troubleshooting Guides with 200+ FAQs Answered

✔ Friendly Support in the Q&A section

✔ Free Udemy Certificate of Completion on Completion of Course

✔ 30 Day “No Questions Asked” Money Back Guarantee!

~~~ Here are a Few Reviews on The in28Minutes Way ~~~

★★★★★ Excellent, fabulous. The way he has prepared the material and the way he teaches is really awesome. What an effort .. Thanks a million

★★★★★ A lot of preparation work has taken place from the teacher and this is visible throughout the course.

★★★★★ This guy is fantastic. Really. Wonderful teaching skills, and goes well out of his way to make sure that everything he is doing is fully understood. This is the kind of tutorial that gets me excited to work with a framework that I may otherwise not be.

★★★★★ The best part of it is the hands-on approach which the author maintained throughout the course as he had promised at the beginning of the lecture. He explains the concepts really well and also makes sure that there is not a single line of code you type without understanding what it really does.

★★★★★ I also appreciate the mind and hands approach of teaching something and then having the student apply it. It makes everything a lot clearer for the student and uncovers issues that we will face in our project early.

★★★★★ Amazing course. Explained super difficult concepts (that I have spent hours on the internet finding a good explanation) in under 5 minutes.

Zero risk. 30 day money-back guarantee with every purchase of the course. You have nothing to lose!

Start Learning Now. Hit the Enroll Button!

******* Step By Step Details *******

You take 12 steps with JUnit and 18 steps with Mockito into unit testing proficiency.

Mocking with Mockito

  • Step 01 : Set up an Eclipse Project with JUnit and Mockito frameworks. First Green Bar.

  • Step 02 : Example to start understanding why we need mocks.

  • Step 03 : What is a stub? Create an unit test using Stub? Disadvantages of Stubs.

  • Step 04 : Your first Mockito code! Hurrah!!! Lets use Mockito to mock TodoService.

  • Step 05 : Stubbing variations with Mockito. A few mockito examples mocking List class : Multiple return values, Argument Matchers and throwing exceptions.

  • Step 06 : Introduction to BDD. Given When Then. BDD Mockito Syntax.

  • Step 07 : How to verify calls on a mock? Verify how many times a method is called. We will add deleteTodo method to the TodoService.

  • Step 08 : How to capture an argument which is passed to a mock?

  • Step 09 : Hamcrest Matchers.

  • Step 10 : Let’s simplify things with Mockito Annotations. @Mock, @InjectMocks, @RunWith(MockitoJUnitRunner.class), @Captor

  • Step 11 : JUnit Rules. Using MockitoJUnit.rule() instead of @RunWith(MockitoJUnitRunner.class).

  • Step 12 : Real world Example with Spring

  • Step 13 : What is a spy? How to spy with Mockito?

  • Step 14 : Some Theory : Why does Mockito not allow stubbing final and private methods?

  • Step 15 : Using PowerMock and Mockito to mock a Static Method.

  • Step 16 : Using PowerMock and Mockito to invoke a private Method.

  • Step 17 : Using PowerMock and Mockito to mock a constructor.

  • Step 18 : Good Unit Tests.

JUnit Framework

  • Step 01 : Need for Unit Testing

  • Step 02 : Setting up your First JUnit

  • Step 03 : First Successful JUnit. Green Bar and assertEquals

  • Step 04 : Refactoring Your First JUnit Test

  • Step 05 : Second JUnit Example assertTrue and assertFalse

  • Step 06 : @Before @After

  • Step 07 : @BeforeClass @AfterClass

  • Step 08 : Comparing Arrays in JUnit Tests

  • Step 09 : Testing Exceptions in JUnit Tests

  • Step 10 : Testing Performance in JUnit Tests

  • Step 11 : Parameterized Tests

  • Step 12 : Organize JUnits into Suites

Zero risk. 30 day money-back guarantee with every purchase of the course. You have nothing to lose!

Start Learning Now. Hit the Enroll Button!

Introduction

1
Introduction
2
Three thing you need to know
3
Congratulations

Unit Testing with JUnit

1
JUnit Step 1 : Why is Unit Testing Important?
2
JUnit Step 2 : Setting up your first JUnit
3
Step 03 : First Successful JUnit. Green Bar and assertEquals
4
Step 04 : Refactoring Your First JUnit Test
5
Step 05 : Second JUnit Example assertTrue and assertFalse
6
Step 06 : @Before @After
7
Step 07 : @BeforeClass @AfterClass
8
Step 08 : Comparing Arrays in JUnit Tests
9
Step 09 : Testing Exceptions in JUnit Tests
10
Step 10 : Testing Performance in JUnit Tests
11
Step 11 : Parameterized Tests
12
Step 12 : Organize JUnits into Suites

Getting Ready for Mockito

1
An Overview
2
Mockito Step 01 : Setting up a Maven Project

Need For Mockito

1
Overview of this Section
2
Mockito Step 02 : Setting up SUT (System Under Test)
3
Step 03 : Stubbing Example - with Disadvantages of Stubbing
4
Step 04 : Your first Mockito code! Hurrah!!!

Mockito Basics

1
Basics of Mockito - Section Overview
2
Step 05 : Stubbing variations with Mockito - Argument Matchers & More...
3
Step 06 : BDD Style - Given When Then
4
Step 07 : Verify calls on Mocks
5
Step 08 : Capturing arguments passed to a Mock

Mockito Advanced

1
Step 09 : Hamcrest Matchers
2
Step 10 : Mockito Annotations - @Mock, @InjectMocks, @RunWith, @Captor..
3
Step 11 : Mockito Junit Rule
4
Step 12 : Real world Mockito Example with Spring
5
Step 13 : Mockito Spy
6
Step 14 : Theory : Why does Mockito not allow stubbing final & private methods?

Powermock with Mockito

1
Step 15 : Setting up PowerMock and SystemUnderTest
2
Step 15 : Continued. Mocking Static Method
3
Step 16 : Invoking Private Methods
4
Step 17 : Mocking a Constructor
5
Step 18 : Writing Good Unit Tests
6
Bonus Lecture : Our Best Selling Courses
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.3
4.3 out of 5
1453 Ratings

Detailed Rating

Stars 5
617
Stars 4
584
Stars 3
202
Stars 2
35
Stars 1
19
e47648223f1814df7ed0cb175fc9f85d
30-Day Money-Back Guarantee

Includes

5 hours on-demand video
2 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion