Mô tả

In this course, you will learn how to write Unit tests and Integration tests in BDD style for Spring Boot applications as well as Spring WebFlux applications using JUnit 5, Mockito, AssertJ, Hamcrest, JsonPath, and Testcontainers frameworks.


Important note: This course updated to use Spring Boot 3.


Type the code along with me in the videos. If you follow along with me then this will enhance your learning experience.


The source code and PDF files (class notes) are available for download.


Spring Boot Overview

Spring Boot is an opinionated framework that helps developers build Spring-based applications quickly and easily.

The main goal of Spring Boot is to quickly create Spring-based applications without requiring developers to write the same boilerplate configuration again and again.

Spring Boot is a very popular framework to develop REST web services and microservices.


Spring WebFlux Overview

Spring 5 includes Spring WebFlux, which provides reactive programming support for web applications.

Spring WebFlux internally uses Project Reactor and its publisher implementations, Flux and Mono.

The new framework supports two programming models:

  • Annotation-based reactive components

  • Functional routing and handling

In this course, we will focus on building reactive REST APIs using annotation-based reactive components.


What you'll learn?

  • Learn to write industry-standard Unit and Integration tests in BDD (Behaviour Driven Development) style using Spring Boot Starter Test dependency from scratch

  • Learn how to use BDD (Behaviour Driven Development) format that is given/when/then to write Unit tests.

  • Learn to Unit test the Spring boot application Repository layer

  • Learn to Unit test the Spring boot application Service layer

  • Learn to Unit test the Spring boot application Controller layer

  • Learn how to do Integration testing for the Spring boot application.

  • Learn how to do Integration testing using Testcontainers // very important

  • You will learn to use the most important Unit Testing ANNOTATIONS - @SpringBootTest, @WebMvcTest, @DataJpaTest, and @MockBean

  • Use ALL the FRAMEWORKS in Spring Boot Starter Test - JUnit, Spring Test, Spring Boot Test, AssertJ, Hamcrest, Mockito, JSONassert, and JsonPath.

  • You will learn to write Unit tests using Mocks and Stubs created with Mockito

  • Learn how to use Mockito annotations to create mock objects.

  • Learn to Write Integration Tests using a MySQL database.

  • You will learn to Write INDEPENDENT Integration tests for RESTFUL web services by talking with MULTIPLE LAYERS - controller, service, and repository layers.

  • Learn Building Reactive CRUD REST APIs using Spring WebFlux

  • Learn Unit Testing Reactive CRUD REST APIs

  • Learn Integration Testing Reactive CRUD REST APIs

Tools and Technologies used in this course:

Technologies and Libraries:

  1. Java 11+

  2. Spring Boot

  3. Spring MVC

  4. Spring Data JPA ( Hibernate)

  5. JUnit 5 Framework

  6. Mockito 4 (Latest)

  7. Hamcrest framework

  8. AssertJ Library

  9. JsonPath Library

  10. Spring WebFlux

  11. MongoDB

IDE:

  • IntelliJ IDEA

Database:

  • H2 In-memory database ( for repository layer testing)

  • MySQL database ( for Integration testing)

  • MongoDB database (for Integration testing)


Amazing reviews from Students on this course:

"Ramesh is a great teacher, he provides very clean explanations on complex concepts."


"Ramesh explains things very well! His instructions are easy to follow and understand. The course is very beneficial"


"✔ Well structured course covering all layers of testing

✔ Implement each method with the "right to the point" explanation

✔ Nice introduction to TestContainers

✔ Easy to code along

✔ Fast answers from the instructor

Looking for more deep dives courses such as Maven, Gradle, DevOps tools used in production"


"Awesome course.

All the basics needed to test a spring application are discussed, and more.

Exactly what i needed and coudn't find anywhere.

Ramesh is a great instructor.

Thank you sir !"


"A very good course explained with excellent examples.

Lot to learn from this course, covered every layer of a typical Spring Boot application."


"I really appreciate the trainer Ramesh to providing is this amazing course,

the content of this course and explanation is great."


"Wonderful Sir, Loved the way u explain things. And I am very lucky that I found this course at right time."


"I am personally very impressed with this course, if you dont have any prior experience of unit testing I am pretty sure that after taking this course you will feel more confident and I would be happy if the lecturer could also release some training tutorials about Microservices and TDD approach. thanks and wish you all the successes."


"Even though as a experience guy, this course was very useful.."


"The course is great and covers all I need to create my tests.

I truly recommend it ."


"Great course. This is the second course I am taking from Ramesh. Interesting so far."


"Awesome course and highly recommend it."


"This course is a good match for me. Especially so because it's new and up to date."


"great teacher and great course"


"Yes this is a good match for me and I am glad I enrolled for this. I personally prefer teaching of ramesh.fadatare. I started to watch his videos from YouTube and also gone through his comments to few problems in stack overflow. I thought it would be good if I can go through all his videos in one go."


"this is what they ask you to do on a real job... please do more courses ramesh.. amazing as always"

Bạn sẽ học được gì

Learn to write industry-standard Unit and Integration tests in BDD (Behaviour Driven Development) style using Spring Boot Starter Test dependency from scratch

Learn how to use BDD (Behaviour Driven Development) format that is given/when/then to write Unit tests.

Learn to Unit test Spring boot application Repository layer

Learn to Unit test Spring boot application Service layer

Learn to Unit test Spring boot application Controller layer - Unit test REST API's

Learn how to do Integration testing for the Spring boot application

You will learn to use the most important Unit Testing annotations - @SpringBootTest, @WebMvcTest, @DataJpaTest, and @MockBean

Use all the frameworks in Spring Boot Starter Test - JUnit, Spring Test, Spring Boot Test, AssertJ, Hamcrest, Mockito, JSONassert, and JsonPath.

You will learn to write Unit tests using Mocks and Stubs created with Mockito

Learn how to use Mockito annotations to create mock objects.

Learn to write Integration Tests using a MySQL database

You will learn to write independent Integration tests for RESTFUL web services talking with MULTIPLE LAYERS - controller, service, and repository layers.

Learn to write Integration Tests using a Testcontainers

Learn Building Reactive CRUD REST APIs using Spring WebFlux and MongoDB

Learn Unit Testing Reactive CRUD REST APIs using JUnit and Mockito

Learn Integration Testing Reactive CRUD REST APIs using WebTestClient

Yêu cầu

  • Java programming
  • Good to know JUnit and Mockito basics
  • Good to know Spring Boot basics
  • Basic understanding of using IntelliJ IDEA

Nội dung khoá học

13 sections

Introduction

7 lectures
Course overview and roadmap
06:33
Best Way to Take This Course and How to Get Help
00:57
What is Unit testing and Integration testing?
06:10
Best practices for Unit testing in Java
10:41
Download Source Code
00:05
Download All the Important Lecture Notes in PDF
00:03
This Course Migrated to Spring Boot 3
00:59

Spring Boot Project Setup

4 lectures
Create and Set up Spring Boot Project in IntelliJ IDEA
07:29
Understanding Spring boot starter test dependency
06:07
Create JPA Entity
07:52
Create Spring Data JPA repository
05:01

Spring Boot - Unit Testing Repository Layer

14 lectures
Repository layer Unit testing overview
06:48
Spring Boot @DataJpaTest annotation
05:38
Unit test for save employee operation
16:04
Unit test for get all employees operation
09:46
Unit test for get employee by id operation
04:54
Unit test for get employee by email operation (Spring Data JPA query method)
07:07
Unit test for update employee operation
10:00
Unit test for delete employee operation
04:54
Unit test Spring Data JPA custom query method using JPQL with index parameters
09:33
Unit test Spring Data JPA custom query method using JPQL with named parameters
05:36
Unit test Spring Data JPA custom native query with index parameters
08:56
Unit test Spring Data JPA custom Native query with Named parameters
03:35
Refactoring JUnit tests to use @BeforeEach annotation
05:10
Download source code of this section
00:04

Spring Boot - Unit Testing Service Layer

12 lectures
Service Layer unit testing overview
04:02
Create EmployeeService with saveEmployee method
07:16
Quick Recap of Mockito basics (before writing JUnit tests to use Mock objects)
07:32
Unit test for EmployeeService saveEmployee method
15:12
Using @Mock and @InjectMocks annotations to mock the object
06:25
Unit test for saveEmployee method which throws Exception
10:33
Unit test for EmployeeService getAllEmployees method - Positive Scenario
07:57
Unit test for EmployeeService getAllEmployees method - Negative Scenario
04:11
Unit test for EmployeeService getEmployeeById method
08:35
Unit test for EmployeeService updateEmployee method
06:59
Unit test for EmployeeService deleteEmployee method
07:52
Download source code of this section
00:04

Spring Boot - Unit Test Controller Layer (Unit Test REST APIs)

17 lectures
Controller Layer unit testing overview
06:28
Overview of @WebMvcTest annotation
02:27
@WebMvcTest VS @SpringBootTest
03:10
Build createEmployee REST API
05:45
Unit test createEmployee REST API
18:58
Build GetAllEmployees REST API
01:31
Unit test GetAllEmployees REST API
08:55
Refactoring JUnit test to use static imports
06:18
Build getEmployeeById REST API
03:35
Unit test getEmployeeById REST API - Positive Scenario
09:42
Unit test getEmployeeById REST API - Negative Scenario
04:06
Build updateEmployee REST API
07:44
Unit test updateEmployee REST API - Positive Scenario
13:16
Unit test updateEmployee REST API - Negative Scenario
05:04
Build deleteEmployee REST API
02:55
Unit test deleteEmployee REST API
06:15
Download source code of this section
00:04

Spring Boot - Integration Testing using Local MySQL Database

11 lectures
Integration testing overview
05:26
@SpringBootTest annotation overview
04:46
Configure MySQL database for integration testing
08:40
Create a base for Integration testing
05:11
Integration test for create employee REST API
05:02
Integration test for get all employees REST API
05:00
Integration test for get employee by id REST API - Positive & Negative Scenarios
06:55
Integration test for update employee REST API - Positive & Negative Scenarios
07:07
Integration test for delete employee REST API
04:15
Integration testing EmployeeRepository using MySQL database
06:57
Download source code of this section
00:04

Spring Boot - Integration Testing using Testcontainers

8 lectures
What problem does Testcontainers solve
07:21
Testcontainers overview
04:54
Adding Testcontainers
04:34
Integration Testing EmployeeController using Testcontainers
17:42
Using @DynamicPropertySource
05:36
Singleton containers pattern
06:39
Integration Testing EmployeeRepository using Testcontainers
04:44
Download source code of this section
00:04

Assignments and Solutions

2 lectures
Assignments for You
00:36
Solution for All the Assignments in One Video
53:49

Quiz - Test Yourself

1 lectures
Quiz to Test Knowledge About This Course
12 questions

Spring WebFlux - Build Reactive CRUD REST APIs

13 lectures
Spring WebFlux Overview
04:01
Spring Boot WebFlux Application Architecture
02:25
Deploy MongoDB in Docker Container
06:03
Create and Set up Spring Boot Project in IntelliJ IDE
06:36
Create Employee Entity
04:47
Create EmployeeRepository and Understanding Internals
05:13
Create EmployeeDto and EmployeeMapper
04:02
Build Reactive Add Employee REST API
13:54
Build Reactive Get Employee REST API
06:34
Build Reactive Get All Employees REST API
05:51
Build Reactive Update Employee REST API
09:28
Build Reactive Delete Employee REST API
05:56
Download source code of this section
00:04

Spring WebFlux - Unit Testing Reactive CRUD REST APIs

7 lectures
Overview of Testing CRUD Reactive REST APIs using WebFlux
06:03
Unit Test Add Employee REST API
13:49
Unit Test Get Employee REST API
07:28
Unit Test Get All Employees REST API
08:28
Unit Test Update Employee REST API
08:28
Unit Test Delete Employee REST API
05:32
Download source code of this section
00:04

Spring WebFlux - Integration Testing Reactive CRUD REST APIs

7 lectures
Integration Test for Add Employee REST API
11:04
Integration Test for Get Employee REST API
06:48
Integration Test for Get All Employees REST API
06:13
Refactor Code
04:02
Integration Test for Update Employee REST API
07:29
Integration Test for Delete Employee REST API
03:42
Download source code of this section
00:04

What's Next?

2 lectures
My Other Top and Bestseller Udemy Courses
01:44
Thank You Note and Feedback About This Course
00:06

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.