Testing Java: JUnit 5, Mockito, Testcontainers, REST Assured (Udemy.com)
Unit Testing & Integration Testing of Java and Spring Boot applications. Test Driven Development(TDD) Explained.
Created by: Sergey Kargopolov
Last updated June 2026
What you will learn
- JUnit 5 - basic & advanced topics
- Test Web Layer and Controllers
- Test Java code with Mockito - the most popular Mocking Framework.
- Test Data layer and JPA Repositories
- Write Spring Boot Integration Tests
- Test Business and Service layer classes
- Master Test Driven Development (TDD)
- Perform Integration testing with Testcontainers
- Test RESTful Web Services with REST Assured
- And more...
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 94 / 100
Course Description
Unit Testing is a must-have skill and this video course is about unit testing.
If you take this video course, you will learn how to test your Java code using JUnit 5 and Mockito framework.
This video course is for beginners and you do not need to have any prior Unit testing knowledge to enrol in this course.
JUnit 5 in Different Java projects
There are different Java projects, build tools and development environments. In this course, you will learn how to create a new project and configure JUnit 5 support for different types of projects, using different development environments and build tools.
You will learn how to create a Unit test in:
IntelliJ IDEA and
Eclipse Development environments.
You will learn how to create a Unit test in:
Regular Java project,
Maven-based Java project,
Cradle-based Java project.
Course Overview
This video course teaches Unit and Integration testing with Java from the very beginning and covers many advanced topics as well. By the end of this course, you will learn:
JUnit 5 basics, and
JUnit 5 advanced topics.
Once you become familiar with JUnit 5, you will learn to use:
Test-Driven Development(TDD)
You will then learn to use another very popular Test framework for Java called:
Mockito
You will also learn how to write:
Spring Boot integration tests, and
Use Testcontainers to integrate real, containerized services(like databases) into your Java application tests, making sure your test scenarios are realistic without complex setup.
and how to test API endpoints using REST Assured.
By the end of this course you will learn and be able to use all of the following:
Create Unit Tests in IntelliJ,
Create Unit Tests in Eclipse,
Run unit tests using Gradle,
Run Unit Tests using Maven,
Use @DisplayName annotation,
Use JUnit assertions,
Test for Exceptions,
Use Lifecycle methods (@BeforeAll, @BeforeEach, @AfterEach, @AfterAll),
Run unit tests in any order you need: (Random, Order by Name, Order by Index),
Disable Unit test,
Repeated Tests with @RepeatedTest annotation,
Parameterized tests with @Parameterized annotation
@ValueSource,
@MethodSource,
@CsvSource,
@CsvFileSource
Change Test Instance lifecycle with @TestInstance (PER_CLASS, PER_METHOD)
Learn to Mock objects with Mockito's @Mock annotation,
Learn to user Mockito's argument matches,
Mockito method stubbing,
Mockito Exception stubbing,
Verify method call,
Call Real Method,
Do nothing when a method is called,
Write integration tests for Spring Boot applications,
and more...
Instructor Details
- 4.7 Rating
2,514 Reviews
Sergey Kargopolov
I have more than 20 years of experience in building different types of software. I started my career as an Entrepreneur with award-winning web projects and currently, I’m a Full Stack Developer with a passion for teaching beginner programmers to reach their goals and assisting them in the development of their applications.
Follow me on Twitter, LinkedIn or Instagram to stay in touch.
Happy learning!
More courses by Sergey Kargopolov
Spring Boot Microservices and Spring Cloud. Build & Deploy. (2026)
4.7 (9,296 Reviews)
Provider: Udemy
Time: 25.8h
$74.99
RESTful Web Services with Spring Framework - A quick start (2024)
4.6 (4,822 Reviews)
Provider: Udemy
Time: 3h
Free
RESTful Web Services, Java, Spring Boot, Spring MVC and JPA (2026)
4.7 (4,325 Reviews)
Provider: Udemy
Time: 25.1h
$79.99
Apache Kafka for Event-Driven Spring Boot Microservices (2026)
4.6 (2,971 Reviews)
Provider: Udemy
Time: 15.2h
$74.99
Event-Driven Microservices, CQRS, SAGA, Axon 4, Spring Boot (2026)
4.4 (2,441 Reviews)
Provider: Udemy
Time: 9.5h
$79.99
More Software Testing courses
ZeroToHero TestNG Framework - From Basics to Advanced (2026)
4.9 (828 Reviews)
Provider: Udemy
Time: 6.2h
$59.99
Selenium WebDriver with Java- Basics to Advanced + Framework (2026)
4.9 (620 Reviews)
Provider: Udemy
Time: 35.5h
$84.99
Rest API Testing (Automation) from Scratch-Rest Assured Java (2026)
4.7 (49,120 Reviews)
Provider: Udemy
Time: 24.6h
$159.99
Quick Introduction to Postman and API Testing for Beginners (2025)
4.7 (23,089 Reviews)
Provider: Udemy
Time: 3.2h
$94.99
Software Testing Masterclass (2026) - From Novice to Expert
4.7 (12,621 Reviews)
Provider: Udemy
Time: 9.9h
$149.99
Webservices API Testing with Rest Assured API & POSTMAN 2025 (2026)
4.7 (2,416 Reviews)
Provider: Udemy
Time: 37.4h
$79.99
Reviews
By Shanthi C on 4/27/2026
I found this course on Testing Java: JUnit 5, Mockito, Testcontainers, REST Assured to be very well-structured and easy to follow. The concepts are explained clearly, making it simple to understand even the more advanced topics. What I especially liked is the engaging teaching style—the instructor keeps the sessions interesting and practical, which really helps in retaining the concepts. The hands-on approach and real-world examples made it easier for me to connect theory with actual implementation. Overall, it’s a great course for anyone looking to strengthen their Java testing skills. I would definitely recommend it to both beginners and those looking to refresh or deepen their knowledge.
By Shivkumar Iyer on 3/18/2026
Very good course that describes in detail how you can write unit tests. I was able to successfully use the testing methods described in the course to write unit and integration tests for other Spring Boot projects I already have in my collection.
By Leon Ramzews on 1/5/2026
I really enjoyed this course. The structure is clear and well thought out, and the topics are very well chosen — it genuinely felt like all the important concepts around testing in Java were covered. From testing HTTP endpoints with REST Assured and databases using Testcontainers, all the way down to testing individual methods in isolation with JUnit and Mockito, everything was included. I also liked the didactic approach: first the theory is explained, and then it’s immediately applied in practice. I especially appreciated that there was concrete code provided to write tests against, which made the learning very practical and hands-on instead of abstract. Another big plus is that the instructor is responsive and helpful — I asked a question and got a reply, which always makes a huge difference in an online course. Overall, a very solid and well-designed course that I’d definitely recommend.
By Hashan Sandeepa on 11/5/2025
Best JUnit course I have ever taken. The lecturer explains each concept in a clear and straightforward manner. The hands-on projects are thoughtfully designed and well-connected, improving practical learning. I highly recommend this course without any hesitation.
By Agracen on 9/11/2025
This course is a must-have for any Java developer looking to get started with unit and integration testing. Sergey does a fantastic job of breaking down complex topics into easy-to-understand lessons. He starts with the absolute basics of JUnit 5, explaining the "why" behind testing, before moving on to essential tools like Mockito. The sections on Spring Boot integration are particularly valuable, showing exactly how to test controllers and data layers in a real-world application. The pacing is perfect, and the hands-on coding makes it very easy to follow along. I now feel confident in my ability to write meaningful tests for my projects. Highly recommended!
By Jorge Casas on 12/1/2024
Solid course on testing in Java/SpringBoot environment. Pros: - It gives you everything you need to start off: JUnit, Mockito, Testcontainers, plus the specific Spring tools. It doesn't go very deep, as this is an introductory course, but it does cover them in enough depth to get you up and running, and you'll understand what you're doing. - It has a perfect pace and doesn't spoonfeed you. If you hate it when a course explains obvious stuff, it's too slow or repeats everything ad nauseam, this course is for you. On the other hand, you'll need to work on the material and can't be too passive, so this point could actually be a downside for some people. Cons: - The Mockito section is way too short. - It could do with more slides and other visual aids as it relies too much on verbal explanations. Sergey's English is pretty good, but his monotone delivery isn't the most engaging, to be honest.
By Harshad Kadam on 8/4/2024
Sergey is the only teacher till now I found engaging. His teaching style is mostly hands on and hence I didn't get any monotonous feeling. I am looking forward to his other courses like microservice and AWS deployment etc.
By Xose Manoel Ramos Fernandez on 7/4/2024
Very complete and instructive course. Theory is provided first (on TDD for example) and then explainde with examples and excersises for student. There are also quizes so you can check your learning progress after some lessons.
By Madu Biradar on 12/8/2022
This course is really amazing for someone who wants to learn test driven development as well as how to write web layer testing along with Integration testing. I would request author to also update some course material as and when spring updates its APIs and also cover test methods for all HTTP Methods.
By Vaclav Vlcek on 11/23/2022
I really liked this course. You will understand the whole concept of testing and practical usage. It is detailed enough to start applying that right away, but not too detailed to get lost. It is real-life oriented, not just listing of all Junit / Mockito functions.












