JUnit and Mockito Crash Course
4.3 (1,313 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
5,682 students enrolled

JUnit and Mockito Crash Course

Learn how to use JUnit and Mockito and Unit Test in easy steps.
4.3 (1,313 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
5,682 students enrolled
Last updated 12/2018
English
English
Current price: $11.99 Original price: $19.99 Discount: 40% off
3 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 3.5 hours on-demand video
  • 1 article
  • 19 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to Udemy's top 3,000+ courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Learn what Unit Testing is
  • Understand the importance of Unit Testing

  • Learn the JUnit Framework and API

  • Learn what mocking is and why we should mock
  • Write tests using JUnit and Mockito
  • Learn What Test Coverage is and how to measure it
  • All in simple and easy steps
  • Spring Testing Quick Start
  • PowerMock Quick Start
  • Parameterized JUnit
Requirements
  • Java Knowledge
  • Eclipse IDE Kepler(or Higher) For Java Developers
Description

Are you a java developer who want to become an expert at Unit Testing ? Then this course is a quick practical guide for you. Learn how to write real unit tests using JUnit and Mockito. This course will simplify things with concepts and step by step implementations .

There are so many java professionals who write great code , but not unit tests. This course aims at filling that gap by covering JUnit and Mockito the two required frameworks to write good unit tests.

Learn and master the most popular unit testing technologies in this comprehensive course.

  • Understand the importance of writing Unit Tests
  • Learn the Syntax of JUnit 4 and 5
  • Demystify the topics of Mocking
  • Write Unit tests using JUnit and Mockito
  • Learn what test coverage is and how to measure it
  • Run unit tests as a part of your Maven build
  • All in easy steps

Mastering Unit Testing for Java Professionals:

JUnit is a open source Framework to test and assert code behavior . Mockito mocks out the dependencies and stub the expectations allowing testing a particular layer/unit in isolation.

Any java developer at any level can access the key lessons and concepts in this course and learn to write quality unit tests.

This course is perfect for every java developer who works on building high quality applications .

Contents and Overview:

In over 2 hours of lectures this course covers necessary JUnit API and its usage with Mockito.

This course covers the importance of unit testing , how to effectively use JUnit ,how mocking works and how to use Mockito to write real unit tests.

Up on completion you will be able to test Java and JavaEE applications ,run unit tests as a part of your build and measure code coverage and improve it.

Who this course is for:
  • Anyone who wants to write quality code
  • Student with java background
  • Java Developers
  • Java EE Developers
Course content
Expand all 76 lectures 03:44:51
+ Introduction
2 lectures 05:52
Unit Testing Introduction
04:06
Unit Testing Introduction
4 questions
+ JUnit in Action
5 lectures 21:55
JUnit Introduction
05:05
JUnit Introductioin
5 questions
Hello JUnit
06:48
Hello JUnit
1 question
Testing for Exceptions
05:20
Exceptions
1 question
@Before and @After
04:18
Before and After
1 question
+ Using JUNIT 5
8 lectures 22:27
Introduction
02:16
Maven Introduction
03:16
Create the project
06:36
Fix the annotations
03:00
Assert Exceptions
01:49
Run Tests
03:01
Run Tests using Maven
01:27
Rest of the course
01:02
+ Mockito in Action
14 lectures 43:51
Mocking Introduction
04:02
Mocking Introduction
2 questions
The Order Processor Usecase
01:25
Create the DAO Layer
04:45
Create the BO Layer
07:55
Add the Mockito Dependency
02:33
Stubbing and Setting Expectations
06:03
Stubbing and setting expectations
4 questions
Verify the results
03:17
Verify the results
1 question
Test a negative scenario
02:50
Mocking Exceptions
02:29
Test Cancel Order
03:19
Cancel Order Negative Scenario
01:13
Cancel Order Exception Scenario
01:52
Cancel Order Exception On Update
01:46
+ Test Coverage
5 lectures 11:19
Test Coverage
02:40
Test Coverage
2 questions
EclEmma Installation
01:43
Measuring coverage using Emma
03:11
Improving the Coverage
03:26
+ More Mockito
8 lectures 19:17
Verification Mode
02:15
Verify More
02:53
Create the ScrapBook Project
04:08
Add the Mockito Dependency
01:21
Stub Void Methods Implicitly
04:52
Stub Void Methods Explicitly
00:45
Use doNothing to test Consecutive calls
02:47
+ Best Practices and Patterns
5 lectures 16:46
The F.I.R.S.T Principle
03:18
Test Doubles Introduction
01:54
Test Doubles In Mockito
03:04
Partial Mocking Using Mockito Spy
06:17
Spy vs Mock
02:13
+ Maven and JUnit Quick Start
3 lectures 12:51
Maven Overview
04:00
Creating a Maven Project
04:03
Running Tests
04:48
+ Parameterized JUnit
5 lectures 12:44
Create The Fields and Constructor
02:49
Create The Static Data Set Method
02:53
Create or Update The Test
02:33
The Parameterized Test Flow
01:33
Parameterized JUnits
3 questions