Course overview

Complete Java Testing: JUnit 5, Mockito and Spring Boot (Practical Backend Guide)

Course content20 lessons
What Are Tests? Unit, Integration, and the Testing Pyramid Explained Simply What Are Tests? Unit, Integration, and the Testing Pyramid Explained Simply Lesson 1 Creating a Maven Project and Setting Up JUnit 5 (Jupiter): Step by Step Creating a Maven Project and Setting Up JUnit 5 (Jupiter): Step by Step Lesson 2 Your First JUnit 5 Test (Step by Step) Your First JUnit 5 Test (Step by Step) Lesson 3 Assertions in JUnit 5: assertEquals, assertTrue, assertNull, and assertThrows Explained Assertions in JUnit 5: assertEquals, assertTrue, assertNull, and assertThrows Explained Lesson 4 @BeforeAll vs @BeforeEach: Test Initialization Explained @BeforeAll vs @BeforeEach: Test Initialization Explained Lesson 5 @ParameterizedTest: Avoid Code Duplication in Your Tests @ParameterizedTest: Avoid Code Duplication in Your Tests Lesson 6 Mockito Basics: Mocking Repositories in a Maven Project (Part 1) Mockito Basics: Mocking Repositories in a Maven Project (Part 1) Lesson 7 Advanced Mockito: when, thenReturn, and Mock Behavior (Part 2) Advanced Mockito: when, thenReturn, and Mock Behavior (Part 2) Lesson 8 Stub vs Mock vs Spy: Real Differences with Practical Examples Stub vs Mock vs Spy: Real Differences with Practical Examples Lesson 9 Testing REST Controllers with Spring Boot, @WebMvcTest, and MockMvc Testing REST Controllers with Spring Boot, @WebMvcTest, and MockMvc Lesson 10 REST Controller Testing: Error Handling and HTTP Status Codes (Part 2) REST Controller Testing: Error Handling and HTTP Status Codes (Part 2) Lesson 11 Complete REST Controller Tests: Best Practices and Real-World Cases (Part 3) Complete REST Controller Tests: Best Practices and Real-World Cases (Part 3) Lesson 12 @WebMvcTest vs @SpringBootTest: Real Differences and When to Use Which @WebMvcTest vs @SpringBootTest: Real Differences and When to Use Which Lesson 13 Complete Project Setup and InMemory Database for Real Tests (Part 1/2) Complete Project Setup and InMemory Database for Real Tests (Part 1/2) Lesson 14 Complete Service and Controller Without DTO: Building a Real Flow (Part 2/2) Complete Service and Controller Without DTO: Building a Real Flow (Part 2/2) Lesson 15 Integration Testing with @SpringBootTest: Full Test of the User API Integration Testing with @SpringBootTest: Full Test of the User API Lesson 16 Advanced Integration Tests with @SpringBootTest: Real-World Scenarios (Part 2) Advanced Integration Tests with @SpringBootTest: Real-World Scenarios (Part 2) Lesson 17 Resetting the Database in Tests: Avoiding Dirty Data with @SpringBootTest (Part 3) Resetting the Database in Tests: Avoiding Dirty Data with @SpringBootTest (Part 3) Lesson 18 Testing the Service with Mockito: Isolated Logic Without Spring Boot Testing the Service with Mockito: Isolated Logic Without Spring Boot Lesson 19 Testing the Controller in Isolation with @MockBean and MockMvc (Without DB) Testing the Controller in Isolation with @MockBean and MockMvc (Without DB) Lesson 20
Previous
Up next Next
Current lesson | Lesson 3/20

Your First JUnit 5 Test (Step by Step)

Complete Java Testing: JUnit 5, Mockito and Spring Boot (Practical Backend Guide) 0%
Let's write the first JUnit 5 test together: test structure, the @Test annotation, how to run the test, and how to read the results. The practical starting point for understanding the basic Java testing flow.
Instructor
G Giovanni Pace
Up next Assertions in JUnit 5: assertEquals, assertTrue, assertNull, and assertThrows Explained