4.19 out of 5
4.19
1347 reviews on Udemy

JUnit and Mockito Crash Course

Learn how to use JUnit and Mockito and Unit Test in easy steps.
Instructor:
Bharath Thippireddy
5,744 students enrolled
English
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

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.

Software Setup

1
Installing Java SDK and Eclipse IDE
2
Download the completed projects

Introduction

1
Course Introduction
2
Unit Testing Introduction
3
Unit Testing Introduction

JUnit in Action

1
Introduction
2
JUnit Introduction
3
JUnit Introductioin
4
Hello JUnit
5
Hello JUnit
6
Testing for Exceptions
7
Exceptions
8
@Before and @After
9
Before and After

Using JUNIT 5

1
Introduction
2
Maven Introduction
3
Create the project
4
Fix the annotations
5
Assert Exceptions
6
Run Tests
7
Run Tests using Maven
8
Rest of the course

Mockito in Action

1
Introduction
2
Mocking Introduction
3
Mocking Introduction
4
The Order Processor Usecase
5
Create the DAO Layer
6
Create the BO Layer
7
Add the Mockito Dependency
8
Stubbing and Setting Expectations
9
Stubbing and setting expectations
10
Verify the results
11
Verify the results
12
Test a negative scenario
13
Mocking Exceptions
14
Test Cancel Order
15
Cancel Order Negative Scenario
16
Cancel Order Exception Scenario
17
Cancel Order Exception On Update

Test Coverage

1
Introduction
2
Test Coverage
3
Test Coverage
4
EclEmma Installation
5
Measuring coverage using Emma
6
Improving the Coverage

More Mockito

1
Introduction
2
Verification Mode
3
Verify More
4
Create the ScrapBook Project
5
Add the Mockito Dependency
6
Stub Void Methods Implicitly
7
Stub Void Methods Explicitly
8
Use doNothing to test Consecutive calls

Best Practices and Patterns

1
The F.I.R.S.T Principle
2
Test Doubles Introduction
3
Test Doubles In Mockito
4
Partial Mocking Using Mockito Spy
5
Spy vs Mock

Maven and JUnit Quick Start

1
Maven Overview
2
Creating a Maven Project
3
Running Tests

Parameterized JUnit

1
Introduction
2
Create The Fields and Constructor
3
Create The Static Data Set Method
4
Create or Update The Test
5
The Parameterized Test Flow
6
Parameterized JUnits

PowerMock Jump Start

1
PowerMock Introduction
2
PowerMock Jump Start
3
Usecase
4
Create the project
5
Download and Add PowerMock Dependencies
6
Prepare For Testing
7
Mock Static Methods and Test

Spring Testing Quick Start

1
Spring Framework Introduction
2
Ticketing Usecase
3
Create the Maven Project
4
Create the DAO Layer
5
Create the Services Layer
6
Update the pom.xml
7
Create the Spring Configuration file
8
Do Dependency Injection
9
Create the JUnit Test
10
Use Spring Test API
11
Test Flow Explained
12
Unit vs Integration Testing

Wrap Up

1
My Other Courses and Discounts
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.2
4.2 out of 5
1347 Ratings

Detailed Rating

Stars 5
628
Stars 4
505
Stars 3
151
Stars 2
41
Stars 1
23
74ececdd9b39ffb077843d770813c651
30-Day Money-Back Guarantee

Includes

4 hours on-demand video
1 article
Full lifetime access
Access on mobile and TV
Certificate of Completion