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.
Spring Boot 2
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.
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).
This in an actual End-To-End test, That means we test the entire application like a user but with codes.