Ưu đãi trong tuần: Nhập mã UD50 giảm 50k cho đơn từ 300k!
Trang chủ
Menu

Spring Boot Unit Testing with JUnit, Mockito and MockMvc

Kiểm thử Đơn vị Spring Boot với JUnit, Mockito và MockMvc

Kiểm thử Đơn vị Spring Boot với JUnit, Mockito và MockMvc

Phát triển Kiểm thử Đơn vị Spring Boot Thời gian Thực: JUnit, Mockito, MockMvc, TDD, JsonPath, Hamcrest, Cơ sở dữ liệu Nhúng H2, MySQL

4.6
(3,853 đánh giá)
26,600 học viên
Giảng viên
Chad Darby
Phụ đề Việt chất lượng cao Phụ đề tiếng Anh Bán chạy Đánh giá cao
50.000đ 349.000đ -86%
✓ Xem giỏ hàng và thanh toán
Bao gồm phụ đề tiếng Việt, tiếng Anh
10.0 giờ video
135 bài giảng
Truy cập vĩnh viễn
Học trên mọi thiết bị
Cập nhật: 30/05/2026

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

Khám phá kiến trúc framework kiểm thử Spring Boot 3 và viết các bài kiểm thử tích hợp
Phát triển kiểm thử đơn vị với JUnit 5 và các câu lệnh Assertion hỗ trợ
Mock các phụ thuộc container Spring bằng Mockito
Áp dụng Phát triển Hướng Kiểm thử (TDD) sử dụng JUnit 5, Mockito và Spring Boot 3
Kiểm thử ứng dụng web Spring Boot MVC với MockMvc và các câu lệnh ModelView
Kiểm thử REST API Spring Boot với MockMvc, JsonPath và Hamcrest
Phát triển kiểm thử tích hợp cho Spring Data JPA bao gồm khởi tạo và dọn dẹp cơ sở dữ liệu
Chúng tôi là GIẢNG VIÊN PHẢN HỒI NHANH ... đăng câu hỏi của bạn và chúng tôi sẽ PHẢN HỒI trong vòng 24 giờ.
Lập trình viên Spring Boot biết kiểm thử với JUnit và Mockito đang có NHU CẦU CAO. Nâng tầm sự nghiệp của bạn!
Bạn có thể TẢI XUỐNG toàn bộ mã nguồn và file PDF. Hoàn hảo cho việc HỌC TẬP và ÔN TẬP ngoại tuyến.

Yêu cầu

Java: Java 17 trở lên
Spring Boot: phiên bản 3.x trở lên
Maven: phiên bản 3.9 trở lên

Đối tượng phù hợp

Khóa học phù hợp với tất cả lập trình viên Spring Boot.

Nội dung khóa học

15 phần • 135 bài giảng
1 Giới thiệu
2 Cách Học Khóa Này và Cách Nhận Hỗ Trợ
3 Tải xuống Mã Nguồn và File PDF
1 Tổng quan về Kiểm thử Đơn vị
2 Phát triển Kiểm thử JUnit - Tổng quan - Phần 1
3 Phát triển Kiểm thử JUnit - Tổng quan - Phần 2
4 Phát triển Kiểm thử JUnit - Thiết lập Dự án
5 JUnit Assertions - Equals/NotEquals và Null/NotNull - Tổng quan
6 Các Phương thức Vòng đời Test Case - Tổng quan
7 Các Phương thức Vòng đời Test Case - Lập trình
8 Định nghĩa Tên Hiển thị Tùy chỉnh - Tổng quan
9 Định nghĩa Tên Hiển thị Tùy chỉnh - Lập trình
10 JUnit Assertions - Same/NotSame và True/False - Tổng quan
11 JUnit Assertions - Same/NotSame và True/False - Lập trình
12 JUnit Assertions - Mảng, Iterable và Dòng - Tổng quan
13 JUnit Assertions - Mảng, Iterable và Dòng - Lập trình
14 JUnit Assertions - Throws và Timeouts - Tổng quan
15 JUnit Assertions - Throws và Timeouts - Lập trình Phần 1
16 JUnit Assertions - Throws và Timeouts - Lập trình Phần 2
17 Sắp xếp Kiểm thử JUnit - Tổng quan
18 Sắp xếp Kiểm thử JUnit - Lập trình
19 Độ phủ mã Kiểm thử Đơn vị với IntelliJ - Tổng quan
20 Độ phủ mã Kiểm thử Đơn vị với IntelliJ - Lập trình
21 Độ phủ mã Kiểm thử Đơn vị với Maven - Tổng quan - Phần 1
22 Độ phủ mã Kiểm thử Đơn vị với Maven - Tổng quan - Phần 2
23 Độ phủ mã Kiểm thử Đơn vị với Maven - Lập trình - Phần 1
24 Độ phủ mã Kiểm thử Đơn vị với Maven - Lập trình - Phần 2
25 Độ phủ mã Kiểm thử Đơn vị với Maven - Lập trình - Phần 3
26 Kiểm thử Có điều kiện - Tổng quan
27 Kiểm thử Có điều kiện - Lập trình - @Disabled và @EnabledOnOs
28 Kiểm thử Có điều kiện - Lập trình - @EnabledIfEnvironmentVariable
1 Tổng quan về Phát triển Hướng Kiểm thử (TDD)
2 Dự án FizzBuzz - Lập trình - Bắt đầu
3 Dự án FizzBuzz - Lập trình - Kiểm thử Phần 1
4 Dự án FizzBuzz - Lập trình - Kiểm thử Phần 2
5 Dự án FizzBuzz - Lập trình - Tái cấu trúc
6 Kiểm thử Tham số hóa - Tổng quan
7 Kiểm thử Tham số hóa - Lập trình - Phần 1
8 Kiểm thử Tham số hóa - Lập trình - Phần 2
9 Ứng dụng Chính FizzBuzz - Lập trình
1 Hỗ trợ Kiểm thử Đơn vị Spring Boot - Tổng quan
2 Kiểm thử Đơn vị Spring Boot - Thiết lập Dự án
3 Kiểm thử Đơn vị Spring Boot - Thêm Phụ thuộc Maven
4 Kiểm thử Đơn vị Spring Boot - Đọc application.properties và Tiêm Spring Beans
5 Kiểm thử Đơn vị Spring Boot - assertEquals và assertNotEquals
6 Kiểm thử Đơn vị Spring Boot - assertTrue, assertFalse và assertNotNull
7 Kiểm thử Đơn vị Spring Boot - Prototype Beans
1 Mocking với Mockito - Tổng quan - Phần 1
2 Mocking với Mockito - Tổng quan - Phần 2
3 Mocking với Mockito - Lập trình - Phần 1
4 Mocking với Mockito - Lập trình - Phần 2
5 Mocking với Mockito - Lập trình - Phần 3
6 MockitoBean - Tổng quan
7 MockitoBean - Lập trình - Phần 1
8 MockitoBean - Lập trình - Phần 2
9 Ném Ngoại lệ với Mocks - Tổng quan
10 Ném Ngoại lệ với Mocks - Lập trình
1 Reflection Test Utils - Tổng quan
2 Reflection Test Utils - Lập trình - Phần 1
3 Reflection Test Utils - Lập trình - Phần 2
4 Reflection Test Utils - Lập trình - Phần 3
1 Dự án Khóa học - Tổng quan Kiểm thử
2 Dự án Khóa học - Xem lại Mã Nguồn
3 StudentAndGradeServiceTest: Tạo Kiểm thử Thất bại
4 StudentAndGradeServiceTest: Tạo Service và Repository
5 StudentAndGradeServiceTest: Làm cho kiểm thử thành công
6 Kiểm thử Tích hợp Cơ sở dữ liệu - Thiết lập và Dọn dẹp - Tổng quan
7 Kiểm thử Tích hợp Cơ sở dữ liệu - Thiết lập và Dọn dẹp - Lập trình
8 StudentAndGradeServiceTest: Xóa Sinh viên
9 Xem lại Cấu hình Cơ sở dữ liệu trong application.properties
10 StudentAndGradeServiceTest: Kiểm thử GradeBook
11 StudentAndGradeServiceTest: Kiểm thử GradeBook với @Sql
1 Kiểm thử Spring MVC Web Controllers - Tổng quan
2 Kiểm thử Spring MVC Web Controllers - Thiết lập Kiểm thử
3 Kiểm thử Spring MVC Web Controllers - Kiểm thử getStudentsHttpRequest
4 Kiểm thử Spring MVC Web Controllers - Assert Tên View
5 Kiểm thử Spring MVC Web Controllers - Tạo Sinh viên - kiểm thử thất bại
6 Kiểm thử Spring MVC Web Controllers - Tạo Sinh viên - kiểm thử thành công
7 Kiểm thử Spring MVC Web Controllers - Cập nhật cho UI Thêm/Lấy Sinh viên - Phần 1
8 Kiểm thử Spring MVC Web Controllers - Cập nhật cho UI Thêm/Lấy Sinh viên - Phần 2
9 Kiểm thử Spring MVC Web Controllers - Xóa Sinh viên
10 Kiểm thử Spring MVC Web Controllers - Trang Lỗi cho Xóa Sinh viên
1 Kiểm thử Ứng dụng Web Spring Boot MVC - TDD cho StudentAndGradeService
2 Kiểm thử Ứng dụng Web Spring Boot MVC - Dịch vụ Điểm cho Môn Toán
3 Kiểm thử Ứng dụng Web Spring Boot MVC - Dịch vụ Điểm cho Môn Khoa học
4 Kiểm thử Ứng dụng Web Spring Boot MVC - Dịch vụ Điểm cho Môn Lịch sử
5 Kiểm thử Ứng dụng Web Spring Boot MVC - Dịch vụ Điểm Kiểm thử Thất bại
6 Kiểm thử Ứng dụng Web Spring Boot MVC - Dịch vụ Điểm @Before và @After
7 Kiểm thử Ứng dụng Web Spring Boot MVC - Tái cấu trúc Dịch vụ Điểm cho Collections
8 Kiểm thử Ứng dụng Web Spring Boot MVC - Xóa Điểm Toán
9 Kiểm thử Ứng dụng Web Spring Boot MVC - Xóa Điểm Lịch sử và Khoa học
10 Kiểm thử Ứng dụng Web Spring Boot MVC - Xóa với ID Sinh viên Không tồn tại
11 Kiểm thử Ứng dụng Web Spring Boot MVC - Cải tiến Xóa Điểm
12 Kiểm thử Ứng dụng Web Spring Boot MVC - Lấy Thông tin Sinh viên - Kiểm thử Thất bại
13 Kiểm thử Ứng dụng Web Spring Boot MVC - Lấy Thông tin Sinh viên - Làm cho Kiểm thử Thành công
14 Kiểm thử Ứng dụng Web Spring Boot MVC - Lấy Thông tin Sinh viên - Không tìm thấy Sinh viên
1 Kiểm thử Ứng dụng Web Spring Boot MVC - Thiết lập SQL Scripts trong file props - Tổng quan
2 Kiểm thử Ứng dụng Web Spring Boot MVC - SQL Scripts trong file props - Chỉnh sửa file props
3 Kiểm thử Ứng dụng Web Spring Boot MVC - SQL Scripts trong file props Student Service
4 Kiểm thử Ứng dụng Web Spring Boot MVC - SQL Scripts trong file props GradebookController
1 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Thông tin Sinh viên - Kiểm thử Thất bại
2 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Thông tin Sinh viên - Kiểm thử Thành công
3 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Tạo Điểm - Kiểm thử Thất bại
4 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Tạo Điểm - Kiểm thử Thành công
5 Kiểm thử Ứng dụng Web Spring Boot MVC - Tái cấu trúc Mã cho Cấu hình Information Model
6 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử Tạo Điểm cho ID Sinh viên Không hợp lệ
7 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử Tạo Điểm cho Môn học Không hợp lệ
8 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Xóa Điểm - Kiểm thử Thất bại
9 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Xóa Điểm - Kiểm thử Thành công
10 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Xóa Điểm - ID Điểm Không hợp lệ
11 Kiểm thử Ứng dụng Web Spring Boot MVC - Kiểm thử MVC cho Xóa Điểm - Môn học Không hợp lệ
12 Kiểm thử Ứng dụng Web Spring Boot MVC - Cập nhật template Thymeleaf Thông tin Sinh viên
13 Kiểm thử Ứng dụng Web Spring Boot MVC - Hiển thị Ứng dụng Đang hoạt động với Cơ sở dữ liệu Nhúng H2
14 Kiểm thử Ứng dụng Web Spring Boot MVC - Tạo file application-test.properties
15 Kiểm thử Ứng dụng Web Spring Boot MVC - Tạo schema Cơ sở dữ liệu MySQL
16 Kiểm thử Ứng dụng Web Spring Boot MVC - Chạy qua ứng dụng sử dụng Cơ sở dữ liệu MySQL
1 Kiểm thử REST API Spring Boot - Tổng quan ứng dụng REST
2 Kiểm thử REST API Spring Boot - Thiết lập Kiểm thử Gradebook Controller - Phần 1
3 Kiểm thử REST API Spring Boot - Thiết lập Kiểm thử Gradebook Controller - Phần 2
4 Kiểm thử REST API Spring Boot - Kiểm thử Lấy Sinh viên - Tổng quan
5 Kiểm thử REST API Spring Boot - Kiểm thử Lấy Sinh viên - Lập trình
6 Kiểm thử REST API Spring Boot - Tạo Sinh viên
7 Kiểm thử REST API Spring Boot - Xóa Sinh viên
8 Kiểm thử REST API Spring Boot - Xóa Sinh viên khi ID Sinh viên Không tồn tại
9 Kiểm thử REST API Spring Boot - Lấy Thông tin Sinh viên
10 Kiểm thử REST API Spring Boot - Lấy Thông tin Sinh viên khi ID Sinh viên không tồn tại
11 Kiểm thử REST API Spring Boot - Tạo Điểm
12 Kiểm thử REST API Spring Boot - Tạo Điểm cho ID Sinh viên không tồn tại
13 Kiểm thử REST API Spring Boot - Tạo Điểm cho Loại Điểm / Môn học Không hợp lệ
14 Kiểm thử REST API Spring Boot - Xóa một Điểm
15 Kiểm thử REST API Spring Boot - Xóa một Điểm khi ID Điểm Không tồn tại
16 Kiểm thử REST API Spring
1 Thank You and Please Leave a Rating for the Course
1 Frequently Asked Questions
1 Bonus

Giới thiệu khóa học

Spring Boot is the most popular framework for building enterprise Java applications. Spring Boot includes testing support to develop unit tests and integration tests using JUnit, Mockito and MockMvc. By developing tests, you can create applications with better code design, fewer bugs, and higher reliability. This course shows you how to take full advantage of Spring Boot's testing support.

You will also use modern development tools such as IntelliJ (free version) and Maven. All of the projects are based on Maven, so you are free to use any IDE tool that you want.

---

In this course, you will get:

- All source code is available for download

- Responsive Instructors: All questions answered within 24 hours

- PDFs of all lectures are available for download

- Professional video and audio recordings (check the free previews)

- High quality closed-captions / subtitles available for English and 14 other languages (new!)

---

Over 3,000+ Reviews!

- (the most reviews for any Spring Boot Unit Testing course on Udemy, nearly DOUBLE the nearest competitor)


Students love this course! 5-star reviews

Chad Darby and Eric Roby are great at delivering the materials and giving good real-world examples of concepts. they make the course a very enjoyable class, This course is very thorough and detailed. Thank you - Ninos


Great course, the material is explained in such a clear way. I enjoy it a lot. Highly recommendable. - Ardak Sydyknazar


Chad Darby's courses are the best on Udemy. Thanks him I've got my first work and got promotion on the second one. Good job, my friend! (c) :) - Andrii Hryhoriev


this is my 4th Course with Mr. Darby, and his courses are so special. Organized, clear concepts, amazing material. and the most important his Knowledge of the Topic and he really deliver the information's for us. just amazing. - Ra'ed Abu Sa'da

---

In this course, you will learn how to:

JUnit

  • Develop JUnit Tests

  • Set up projects to use JUnit

  • Apply JUnit assertions: Equals/Not Equals and Null/NotNull

  • Apply JUnit assertions: Same/Not Same and True/False

  • Leverage JUnit lifecycle annotations

  • Define custom display names for JUnit tests

  • Check for exceptions and timeouts

  • Define execution order in JUnit tests

  • Perform code coverage analysis for JUnit tests

  • Apply conditionals with JUnit tests


Test Driven Development (TDD)

  • Apply Test Driven Development for build tests and application code

  • Create a failing test first

  • Update your code to make the tests pass

  • Take your tests from RED to GREEN

  • Apply TDD to a coding project

  • Leverage parameterized tests with TDD


Spring Boot Unit Testing Support

  • Explore annotations for Spring Boot Unit Testing support

  • Apply the @SpringBootTest annotation

  • Read Spring Boot application properties and inject values using the @TestPropertySource annotation

  • Perform assertEquals and assertNotEquals

  • Leverage Spring Boot singleton beans and prototype beans


Mocking with Mockito

  • Identify the need for mocking during test development

  • Leverage Mockito in JUnit tests

  • Applying the @MockitoBean annotation for injection (new in Spring Boot 3.4)

  • Throwing exceptions with Mocks


Spring Reflection Utils

  • Identify use cases for applying reflection in your JUnit tests

  • Apply ReflectionTestUtils to access non-public fields and methods

  • Integrate Spring Reflection Utils in your JUnit tests


Database Integration Testing

  • Identify the need for database integration testing during test development

  • Add database setup and clean code using @BeforeEach and @AfterEach

  • Leverage an embedded database to ease with testing setup and maintenance.

  • External SQL statements using @Sql annotation


Testing Spring Boot MVC Web Apps with MockMvc

  • Apply Spring Boot using testing for a Spring MVC CRUD web app

  • Identify use cases for testing Spring MVC @Controller

  • Configure the JUnit test case using @AutoConfigureMockMvc

  • Inject the MockMvc dependency for testing Spring MVC Controllers

  • Send HTTP Requests to Spring MVC Controllers and assert the results

  • Assert the view name returned by the Spring MVC Controller

  • Assert model attributes for the desired values


Testing Spring Boot REST APIs with MockMvc

  • Apply Spring Boot using testing for a Spring REST CRUD API

  • Inject the MockMvc dependency for testing Spring MVC @RestController

  • Send HTTP Requests to Spring MVC @RestController and assert the results

  • Leverage Jackson Object Mapper to send JSON data to REST API endpoint

  • Expect successful response and desired content type

  • Apply JsonPath to verify contents of JSON response



Compared to other Spring Boot Unit Testing courses

This course is up to date and covers recent versions of Spring Boot 3. We make use of modern development tools such as IntelliJ (free version) and Maven.

We are very responsive instructors and we are available to answer your questions and help you work through any problems.

Finally, all source code is provided with the course along with setup instructions.


Student Reviews Prove This Course's Worth

Those who have reviewed the course have pointed out that the instruction is clear and easy to follow, as well as thorough and highly informative. 

Many students had also taken other Spring Boot Unit Testing courses in the past, only to find that this Spring Boot Unit Testing course was their favorite. They enjoyed the structure of the content and the high quality audio/video.


Sample of Student Reviews - 5 stars!

Chad Darby and Eric Roby are great at delivering the materials and giving good real-world examples of concepts. they make the course a very enjoyable class, This course is very thorough and detailed. Thank you - Ninos


Great course, the material is explained in such a clear way. I enjoy it a lot. Highly recommendable. - Ardak Sydyknazar


Chad Darby's courses are the best on Udemy. Thanks him I've got my first work and got promotion on the second one. Good job, my friend! (c) :) - Andrii Hryhoriev


this is my 4th Course with Mr. Darby, and his courses are so special. Organized, clear concepts, amazing material. and the most important his Knowledge of the Topic and he really deliver the information's for us. just amazing. - Ra'ed Abu Sa'da



Quality Material

You will receive a quality course, with solid technical material and excellent audio and video production. I am a best-selling instructor on Udemy. Here's a list of my top courses.

  • Full Stack: React and Spring Boot

  • Full Stack: Angular and Spring Boot E-Commerce Website

  • Spring and Hibernate for Beginners

  • Hibernate: Advanced Development Techniques

  • Deploy Spring Boot 4 Apps Online to Amazon Cloud (AWS)

  • JSP and Servlets for Beginners

  • JavaServer Faces (JSF) for Beginners

These courses have received rave 5 star reviews and over 900,000 students have taken the courses. Also, these courses are the most popular courses in their respective categories.

I also have an active YouTube channel where I post regular videos. In the past year, I’ve created over 1200 video tutorials (public and private). My YouTube channel has over 7 million views and 43k subscribers. So I understand what works and what doesn’t work for creating video tutorials.


No Risk – Udemy Refund 

Finally, there is no risk. You can preview 25% of the course for free. Once you purchase the course, if for some reason  you are not happy with the course, Udemy offers a 30-day refund (based on Udemy's Refund Policy).

So you have nothing to lose, sign up for this course and learn how to apply Spring Boot Unit Testing


Target Audience

Java Developers with Spring Boot experience

Khóa học liên quan

Khám phá thêm các khoá học cùng chủ đề

Hiển thị tất cả khoá học Java
Hiển thị tất cả khoá học Software Development
Hiển thị tất cả khoá học Spring Boot
Hiển thị tất cả khoá học Unit Testing
Zalo
Tôi có thể tư vấn khoá học cho bạn 😊