Master Unit Testing in Spring Boot | JUnit, Mockito | Step-by-Step Tutorial

Published: 17 November 2024
on channel: Genuine Coder
26,230
599

Learn how to write unit tests for your Spring Boot application. This tutorial starts with simple unit tests for basic utility functions and then proceeds to cover detailed functionalities of JUnit, Mockito, and Spring Security test libraries. You'll also discover the benefits of using in-memory databases like H2 for testing, especially in DevOps CI/CD pipelines. This guide is suitable for both beginners and experts looking to master unit testing.

📚 Chapters:
(00:00:00) Introduction
(00:05:29) 1.1. Familiarize with sample project
(00:07:08) 1.2. Write the first unit test
(00:21:26) 1.3. Using @SpyBean for mocking methods
(00:32:36) 2. Unit test for controllers and API endpoints
(00:47:16) 3. Unit test with Spring Security Test | WithMockUser
(00:57:40) 4. Special in-memory database for unit tests

Find the project on GitHub: https://github.com/afsalashyana/Sprin...
Spring security tutorial:    • Spring Boot 3 Security Tutorial | Authenti...  
More Spring boot full courses:    • Spring Boot Tutorials  

#unittest #mockito #springframework #springboot #java


On this page of the site you can watch the video online Master Unit Testing in Spring Boot | JUnit, Mockito | Step-by-Step Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Genuine Coder 17 November 2024, share the link with friends and acquaintances, this video has already been watched 26,230 times on youtube and it was liked by 599 viewers. Enjoy your viewing!