Testing Java: JUnit 5, Mockito, Testcontainers, REST Assured
Unit Testing & Integration Testing of Java and Spring Boot applications. Test Driven Development(TDD) Explained.
Lo que serás capaz de hacer
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...
- 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
Temario
UNIDAD 1 - Introduction · 10 leccionesUNIDAD 1 - Introduction
UNIDAD 1 - Introduction
- Introduction
- Welcome from the instructor
- What is a Unit Test?
- Why write Unit Test?
- The F.I.R.S.T Principle
- Testing Code in Isolation
- Testing Pyramid
- Quiz. Basics of Unit Testing
- What is JUnit 5?
- JUnit and Build Tools
UNIDAD 2 - Add JUnit 5 to Maven project · 3 leccionesUNIDAD 2 - Add JUnit 5 to Maven project
UNIDAD 2 - Add JUnit 5 to Maven project
- Create new Maven project using IntelliJ IDEA
- Add JUnit Dependencies
- Maven Surefire Plugin [Skip if you use newer version of Spring Boot]
UNIDAD 3 - Add JUnit 5 to Gradle project · 3 leccionesUNIDAD 3 - Add JUnit 5 to Gradle project
UNIDAD 3 - Add JUnit 5 to Gradle project
- Creating a new project
- Add JUnit Dependencies
- Executing Unit Test
UNIDAD 4 - Add JUnit 5 to a basic Java project · 3 leccionesUNIDAD 4 - Add JUnit 5 to a basic Java project
UNIDAD 4 - Add JUnit 5 to a basic Java project
- Introduction
- Basic Java project with IntelliJ
- Basic Java project with Eclipse
UNIDAD 5 - Basics of JUnit 5 · 18 leccionesUNIDAD 5 - Basics of JUnit 5
UNIDAD 5 - Basics of JUnit 5
- Introduction
- Creating First Unit Test method
- Assertions and Assertion message
- Assertion Message
- Other assertions
- JUnit Test Exercise
- Exercise solution overview
- Lazy Assert Messages
- Naming Unit Tests
- @DisplayName annotation
- Test Method Code Structure. Arrange, Act, Assert.
- JUnit Test Lifecycle
- Lifecycle methods demo
- Quiz - JUnit Test Lifecycle
- Disable Unit Test
- Assert an Exception
- Assert an Exception - Practice exercise
- Testing for IllegalArgumentException: Solution overview
UNIDAD 6 - Advanced JUnit 5 · 15 leccionesUNIDAD 6 - Advanced JUnit 5
UNIDAD 6 - Advanced JUnit 5
- @ParameterizedTest. Multiple Parameters with @MethodSource.
- @ParameterizedTest. Multiple parameters with @CsvSource.
- @ParameterizedTest + CSV file
- @ParameterizedTest + @ValueSource annotation.
- Repeated Tests
- Methods Order - Random order
- Methods Order - Order by name
- Methods Order - Random by order index
- Order of Unit Test Classes
- Methods Execution Order - Quiz
- Test Instance Lifecycle - Introduction
- Changing Test Instance Lifecycle - example 1
- Test Instance Lifecycle Demo project overview
- Test Instance Lifecycle Demo Project Implementation
- Test Instance Lifecycle - Quiz
UNIDAD 7 - Test Driven Development (TDD) in Java · 12 leccionesUNIDAD 7 - Test Driven Development (TDD) in Java
UNIDAD 7 - Test Driven Development (TDD) in Java
- Introduction to the Test Driven Development(TDD) in Java
- New project, Class, Method
- Creating UserService
- Test Create User method
- Test User object contains first name
- Test Driven Development(TDD) - Refactor Test method
- Test Driven Development(TDD) - Exercise
- Test Driven Development(TDD) - Solution overview
- Check if user id is set
- Assert throws Exception
- TDD - Exercise 2
- Test Driven Development in Java - Quiz.
UNIDAD 8 - Mockito - Create Mocks to test Java code in isolation · 14 leccionesUNIDAD 8 - Mockito - Create Mocks to test Java code in isolation
UNIDAD 8 - Mockito - Create Mocks to test Java code in isolation
- Introduction to Mockito
- Adding Mockto to a Java project
- Method under test overview
- Implementing UsersRepository
- Injecting UsersRepository as Dependency
- Mockito - Creating a Mock object
- Stubbing using built-in any() argument matcher
- Mockito - Verify method call
- Mockito - Exception stubbing
- Creating EmailNotificationService class
- Mockito - Stub a void method with Exception
- Mockito - Do nothing when method is called
- Mockito - Call a real method
- Mockito - Quiz
UNIDAD 9 - Code Coverage - Identify untested code in your Java application · 7 leccionesUNIDAD 9 - Code Coverage - Identify untested code in your Java application
UNIDAD 9 - Code Coverage - Identify untested code in your Java application
- Code Coverage - Introduction
- Generating JUnit Code Coverage report with IntelliJ
- Export JUnit Code Coverage Report using IntelliJ
- Export JUnit Test Report using Maven
- Jacoco - Maven Plugin for Code Coverage
- Jacoco - Export Code Coverage Report in HTML format
- Code Coverage - Quiz
UNIDAD 10 - Spring Boot (Part 1) - Testing Rest Controllers · 13 leccionesUNIDAD 10 - Spring Boot (Part 1) - Testing Rest Controllers
UNIDAD 10 - Spring Boot (Part 1) - Testing Rest Controllers
- Introduction to JUnit Testing of Spring Boot Application
- Introduction to Integration Testing of Web Layer
- Introduction to Integration Testing of All Layers in Spring Boot application
- Adding Testing Support to a Spring Boot Application
- Existing Project overview + Source code
- New Test Class. @WebMvcTest & @AutoConfigureMockMvc.
- RequestBuilder - Building and Performing HTTP Request
- @MockBean - Mocking Service Layer
- @MockBean annotation - Trying how it works.
- Assert for BAD_REQUEST
- Testing Rest Controller - Practice exercise
- Testing Rest Controller - Practice exercise solution overview
- Testing Spring Boot application - Quiz
UNIDAD 11 - Spring Boot (Part 2) - Testing All layers · 16 leccionesUNIDAD 11 - Spring Boot (Part 2) - Testing All layers
UNIDAD 11 - Spring Boot (Part 2) - Testing All layers
- Testing All layers of Spring Boot Application - Introduction
- @SpringBootTest annotation
- @SpringBootTest WebEnvironment MOCK
- @SpringBootTest: Defined Port Number
- @TestPropertySource. Loading alternative configuration.
- @SpringBootTest: Random Port Number
- Test Create User - User Details JSON
- TestRestTemplate - Prepare & Perform HTTP Post Request
- Trying how it works
- Test JWT is Required
- Test User Login Works
- Order Test Methods
- GET /users. Include JWT Token in the Request
- Source code
- More lessons are about to be uploaded
- Spring Boot Integration Testing - Quiz
UNIDAD 12 - Spring Boot(Part 3). Testing Data Layer Only. JPA Entities. · 7 leccionesUNIDAD 12 - Spring Boot(Part 3). Testing Data Layer Only. JPA Entities.
UNIDAD 12 - Spring Boot(Part 3). Testing Data Layer Only. JPA Entities.
- Introduction to testing JPA Entities in Spring Boot application
- JPA Entity Overview + Source Code
- Test that UserEntity can be persisted
- Test UserEntity cannot be persisted with invalid user's first name
- Excersize - Test that UserId is Unique
- Excersize solution + Source code
- Testing Data Layer of Spring Boot Application - Quiz
UNIDAD 13 - Testing JPA Repositories · 5 leccionesUNIDAD 13 - Testing JPA Repositories
UNIDAD 13 - Testing JPA Repositories
- Introduction to testing JPA Repositories
- Testing Find By Email Query Method
- Excersize - Test Find By User Id Query Method
- Excersize solution overview + Source code
- Test JPQL Query + Source code
UNIDAD 14 - Integration testing with Testcontainers · 13 leccionesUNIDAD 14 - Integration testing with Testcontainers
UNIDAD 14 - Integration testing with Testcontainers
- Introduction to Testcontainers
- System Under Test(SUT) overview + Source Code
- Adding support for Testcontainers to a Spring Boot application
- @Testcontainers annotation: Enable Testcontainers in a Test class
- @Container annotation: Creating a MySQL container
- @DynamicPropertySource annotation. Connecting to MySQL container.
- Test if container is running
- @ServiceConnection annotation: Connecting to MySQL container.
- MySQL Container: Test User can be created
- Order test methods
- PostgreSQL Testcontainers configuration
- 'Oracle Free' Testcontainers configuration
- Apache Kafka Testcontainers configuration
UNIDAD 15 - Testing RESTful Web Services(REST APIs) with REST Assured · 25 leccionesUNIDAD 15 - Testing RESTful Web Services(REST APIs) with REST Assured
UNIDAD 15 - Testing RESTful Web Services(REST APIs) with REST Assured
- REST Assured - Introduction
- Overview of an Application Under Test
- Introduction to an initial test class
- Adding Rest Assured to Spring Boot application
- Recap: Adding REST Assured Maven Dependency
- Creating a new test method
- Given-When-Then format
- Recap: Given-When-Then
- given() - Setting up HTTP Headers
- given() - Setting up HTTP Body
- when() - Sending HTTP Request
- then() - Extract and Validate HTTP Response Body
- then() - Extract and validate HTTP Response
- then() - validate HTTP Response using REST Assured methods
- Log() - Logging HTTP Request Details in REST Assured
- Log() - Logging HTTP Response Details in Rest Assured
- Request and Response Logging filters in REST Assured
- Summary: Request and Response Logging filters
- Using Request Specification in REST Assured
- Using Response Specification in REST Assured
- Testing /login API Endpoint
- Testing Protected API endpoint - GET /users/{userId}
- Testing /users/{userId} - Negative scenario.
- Query String Request Parameters in REST Assured
- Next lesson
UNIDAD 16 - What's next? · 2 leccionesUNIDAD 16 - What's next?
UNIDAD 16 - What's next?
- Let's connect!
- Bonus lecture
Tu certificado lo emite la SEP, no solo una plataforma
Al demostrar la competencia recibes un certificado emitido por la Secretaría de Educación Pública a través del Gobierno del Estado de México: un documento oficial que puedes presentar con confianza ante cualquier empleador o institución.
Tu certificado con INEC
- Lo emite la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México
- Documento oficial con folio verificable en línea
- Lo otorga la Universidad Tecnológica Fidel Velázquez
Otras plataformas en línea
- Constancia privada emitida por la misma plataforma
- Solo acredita horas cursadas o asistencia
- Sin respaldo de una autoridad educativa
Tu itinerario, de la inscripción al certificado
- 1
Inscripción con pago único
Pagas $2,800 MXN una sola vez y entras de inmediato al curso.
- 2
Estudias a tu ritmo
16 unidades con videos, lecturas y actividades, disponibles 24/7 durante 12 meses.
- 3
Cuestionarios por unidad
11 cuestionarios para comprobar lo aprendido.
- 4
Certificado
Emitido por la SEP a través del Gobierno del Estado de México, con folio verificable.
Un certificado oficial de la SEP
- Emitido por la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México. No es una constancia privada: es un documento oficial, y ese respaldo marca la diferencia frente a otras plataformas en línea.
- Contenido impartido por Sergey Kargopolov.
- Folio y QR verificables para compartirlo con quien te contrate.
Empieza hoy, a tu ritmo
Un solo pago y acceso inmediato al curso completo durante 12 meses.
- 16 unidades · 166 lecciones · 60 h
- 12 meses de acceso
- 11 cuestionarios de evaluación
- Certificado emitido por la SEP (Gob. del Estado de México) con folio verificable
Sobre tu inscripción
¿Cómo es el pago?
Un solo pago de $2,800 MXN. No hay mensualidades ni cargos recurrentes.
¿Cuánto tiempo tengo acceso?
12 meses desde tu inscripción, 24/7, para avanzar a tu ritmo.
¿Quién imparte el contenido?
El curso es impartido por Sergey Kargopolov; INEC gestiona tu inscripción, evaluación y certificado.
¿Qué pasa cuando vence mi acceso?
Puedes renovar tu cuenta tú mismo desde la plataforma, sin trámites ni esperas.


