
Explore reactive programming as an asynchronous, non-blocking data-flow paradigm built on a publisher-subscriber model. See how backpressure and functional style in Java enable scalable, efficient processing of streams.
Explore the reactive streams specification and its four core interfaces (publisher, subscriber, subscription, processor) and see how libraries like Project Reactor implement them to enable reactive Java programming.
Explore the reactive stream workflow in Java by linking publisher and subscriber through subscription, request, onNext, onComplete, and onError, and see how these five steps drive reactive data flow.
Learn how Project Reactor implements reactive streams with Mono and Flux in Spring WebFlux, including subscribe and handling on next, on complete, and on error.
Explore Spring WebFlux, a reactive web framework built on Spring Framework 5 and Project Reactor, for building reactive web apps and rest APIs using the reactive MongoDB driver.
Architect a Spring Boot webflux app with controller, service, repository layers, where methods return mono or flux and use a MongoDB to build reactive employee rest CRUD api.
Set up MongoDB in a Docker container by pulling the official image from Docker Hub. Use port mapping and access the MongoDB shell with docker exec to view databases.
Set up a Spring Boot project in IntelliJ using Spring Initializr, Maven, Java 17, and Spring Boot 3.0.1, and add the Spring Reactive Web, MongoDB Reactive, and Lombok dependencies.
Create an employee mongodb entity in a spring boot project with id, first name, last name, and email, using lombok for getters setters and constructors, stored in the employees collection.
Create an employee repository that extends reactive crud repository to perform CRUD operations on the employee entity in MongoDB, and learn how Mono and Flux represent asynchronous reactive types.
Create an employee dto and an employee mapper to transfer data between client and server; implement map-to-dto and map-to-entity methods using Lombok, for use in reactive rest apis.
Build a reactive add employee API using spring webflux, implementing service and controller layers, converting employee DTO to entity with mapper, saving via mongodb and returning mono with 201 created.
Builds a reactive get employee rest api in Spring WebFlux using mono to fetch an employee by id and map the entity to an employee dto.
Implement a reactive get all employees rest API by wiring the service to return a flux of employee DTOs, mapping from entities, and exposing a get endpoint.
Build a reactive update employee REST API with Spring WebFlux and MongoDB, implementing the service and controller layers with Mono, flatMap, and DTO mapping to update records.
Build a reactive delete employee rest api using Spring WebFlux, implementing a Mono return type via delete by id with a delete mapping and no content status.
Discover unit testing and integration testing in a Spring Boot three-layer app. Learn JUnit and Mockito for unit tests and validate controller–service–repository flow with the database.
Explore unit testing best practices in Java: separate test code from production, mirror package structures in src/test, use given when then naming, proper assertions, and mock dependencies with Mockito.
Learn to unit test a Spring WebFlux controller using WebFluxTest annotation and mock bean annotations, with Mockito to simulate service dependencies, and verify CRUD reactive REST APIs using WebTestClient.
Unit test a reactive save employee REST API built with Spring WebFlux. Mock the service with @MockBean and verify a 201 created JSON response using a given-when-then style test.
This lecture guides how to unit test the reactive Get employee REST API using JUnit, web test client, and Mockito, asserting status 200 and employee object fields.
Unit test the get all employees REST API by mocking the employee service to return a flux of employee DTOs, then verify 200 response with JSON list of employees.
Unit test the reactive update employee REST API with Spring WebFlux, WebTestClient, and Mockito; verify HTTP 200 and updated first name, last name, and email.
Write a unit test for the delete employee REST API using WebTestClient in a Spring WebFlux app, stubbing the service to return Mono.empty, and verify HTTP 204 no content.
Write an integration test for the add employee rest API using Spring Boot Test, WebTestClient, and a reactive flow from controller to service to repository to database.
Write an integration test for getemployee rest api using a web test client. Save an employee to database and verify id, first name, last name, and email with jsonpath.
Write an integration test for the get all employees REST API using a web test client, insert two employees in MongoDB, then get /api/employees and verify a 200 JSON array.
Refactor the test setup to run before each test, clearing the MongoDB collection via the employee repository's delete all method, ensuring a clean start for every JUnit test.
Write an integration test for the update employee REST API using a reactive web test client, validating updated first name, last name, and email in MongoDB.
Write an integration test for delete employee rest api using a MongoDB database collection, invoking web client delete on /api/employees with the employee id and asserting http 204 no content.
In this course, you will learn how to build and Unit test Reactive REST APIs for Employee Management System projects using Java, Spring Boot, WebFlux, REST, MongoDB, and IntelliJ IDEA.
Learn to build powerful Reactive REST APIs using Java, Spring Boot, and WebFlux in this beginner-friendly course. You'll discover how to handle data in a reactive way, making your applications more efficient and scalable. We’ll work with MongoDB for data storage, ensuring your projects are up-to-date with modern web development practices.
Testing is a key part of building reliable software, so you’ll also learn how to write clear and effective Unit and Integration tests. Using tools like JUnit and Mockito in IntelliJ IDEA, you'll gain the skills to ensure your code works as expected.
By the end of this course, you'll have the confidence to build and test reactive applications, setting you apart in today’s tech world.
Tools and Technologies Used:
Java 17+
Spring Boot 3
Spring WebFlux
Project Reactor
Maven
IntelliJ IDEA
MongoDB
Docker
What You’ll Learn:
How to build Reactive REST APIs with Spring Boot and WebFlux.
How to use MongoDB for reactive data handling.
The basics of reactive programming in Java.
How to write Unit tests for Reactive REST APIs.
How to create and run Integration tests for Reactive REST APIs.
How to use IntelliJ IDEA for coding and testing.