Passionate software engineer focused on creating high-performance, scalable systems. With expertise in Java, API design, and a keen interest in AI and large language models, I’m dedicated to exploring how cutting-edge technologies can drive innovation in software.
Processing Real-Time data is a big challenge then Reactive tools come and help us to make an Asynchronous application without being involved with Low-Level headaches. This is a Reactive RESTful Web Service with Integration (End-To-End) test.
Tech Stack
Java 8
Spring Boot 2
WebFlux
REST standards
Swagger UI
H2
JUnit 4
Reactor
Maven Dependencies
It’s the time to create a Maven Project and put the below dependencies on your POM.xml file.
DB config (application.yml)
I used H2 to make this application more independent.
CustomerController.java
CustomerServiceImpl.java
CustomerRepository.java
As you see our repository is not reactive, because Spring does not support reactive interface “ReactiveCrudRepository” for RDBMS, but we made a web and service layer reactive! If you need an entire Reactive application you should use NoSQLs (Redis, MongoDB, Cassandra, …).
Run Spring Boot
To make WebFlux Enabled we need “@EnableWebFlux” annotation.
It’s time to see what we have done, we can just run a Boot project with mvn spring-boot:run or use any IDE you like. If your Application is running on PORT 8080 just open http://localhost:8080/swagger-ui.html then you will see all Restful Endpoints (/customers).
CustomerIntegrationTest.java
This in an actual End-To-End test, That means we test the entire application like a user but with codes.
We always have been using abstraction to make things more robust, reusable, and readable. Nowadays geeks use it as a term called “Container” to have a simple...
In the real world if you ask a question from an ordinary person of the 21 century and if that person did not know about answer then he/she will immediately a...