Spring Boot Testing with JUnit 5, Mockito & Testcontainers

Unit tests and Integration tests for Spring Boot App and Spring WebFlux App using JUnit 5, Mockito and Testcontainers

4.6|Reviews (1.6K)|verifiedIncluded in Subscription
radio_button_checkedPersonal Plan
₹375/mo
₹50025% OFF
Get this course and thousands more with a Personal Plan subscription.
radio_button_uncheckedIndividual Course
619428986% OFF
Keep the course forever with lifetime access and receive a certificate.
Team Plan₹2,000.00 a month per user
₹24,000/mo
Enterprise PlanCustom Pricing
Custom Pricing

Why choose Personal Plan?

check
28,000+ Courses
check
20,000+ Practice Exercises
check
9,000+ Top Instructors
check
Personalized Learning
verifiedGet this course for free with the Personal Plan subscription.
✓ Compare courses before making a decision
Check Latest Price →
Price may vary. Check latest price on provider site.

Course Insight

Suitable for intermediate learners. Works well as a continuation after mastering Software Development Tools fundamentals. It bridges the gap toward advanced, production-level engineering.

Intermediate FriendlyCertification FocusedSelf-Paced LearningProject-Based

SKILLS TO
MASTER

Software Development Tools Basics
Fundamental principles and concepts
Practical ApplicationTrending
Real-world project implementation
Best Practices
Industry standard workflows and guidelines
Problem Solving
Core Concepts
Implementation
Workflow Integration
Optimization
Careers:Frontend Developer, Full Stack Developer, Web Engineer.

Quick Facts

Below sections are verified from last major sync. For real-time updates and today's latest lectures, Check official page here.

What You’ll Learn

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.

Recent update

: I have added lectures on JUnit 5 fundamentals.

Important note:

This course is 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 repeatedly. Spring Boot is a popular framework for developing 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 This course will focus on building reactive REST APIs using annotation-based reactive components.

What you'll learn?

Learn JUnit 5 framework fundamentals.

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)

Excellent reviews from Students on this course:

"Ramesh is a great teacher; he provides very clear explanations of 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"

See how this course curriculum compares with alternatives

Outcomes

  • 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 everything about JUnit Framework 5 .
  • 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 Show moreShow less.
See side-by-side differences in learning outcomes

Course Curriculum

23 sections • 144 lectures • 16h 24m total length

FAQs

Instructor

RF

Ramesh Fadatare (Java Guides)

4.5 Rating13,421 Reviews112,770 Students19 Courses
Ramesh Fadatare (Java Guides) Software Engineer, Spring Certified, YouTuber and Instructor Hi, I'm Ramesh Fadatare, a Software Engineer with 12+ years of experience in Java, Spring Boot, Microservices, Hibernate, Angular, React, and related open-source technologies. I am a VMware Spring Certified Professional. Check out my blog to learn more about this certification. I am a founder and author of the top Java blog website, Java Guides (1 million views per month) , I am also a YouTuber with 175K+ subscribers. I have published around 200+ free sample projects on GitHub (5K followers). Note: All my courses are only available on the Udemy platform, so you can join here.

Reviews

4.7 / 5 average rating from 1.6K+ learners

View detailed reviews on Udemy
Unsure about these reviews? Compare with other top courses

Deals

This course is currently available at a discounted price  619 4289 (86% OFF)  on Udemy. Udemy also offers deals on other courses from time to time — click below to explore

Explore Deals on Udemy →

Deals and prices are set by the provider and may change. Please check final details on the provider’s site.

Top Alternatives

Highly-rated courses worth your attention

Docker Masterclass For Java Spring Boot Developers
4.6· 10h 42m
Intermediate
₹529₹2,75981% OFF
CMake, Tests and Tooling for C/C++ Projects [2024 Edition]
4.3· 6h 24m
Intermediate
₹569₹3,92986% OFF
AWS CodeCommit CodeBuild CodeDeploy CodePipeline | Hands On
4.6· 3h 36m
Intermediate
₹479₹2,52981% OFF
DevOps, CI/CD(Continuous Integration/Delivery) for Beginners
5.0· 55m
Beginner
₹579₹2,59978% OFF
Docker and Kubernetes: The Complete Guide
4.6· 21h 40m
Beginner
₹609₹4,22986% OFF
Docker Mastery: with Kubernetes +Swarm from a Docker Captain
4.5· 22h 59m
Intermediate
₹689₹4,13983% OFF
Spring Boot Testing with JUnit 5, Mockito & Testcontainers
4.6(1.6K+ learners)