- Java 11
- Spring Boot 2.6.4
- Lombok to avoid boilerplate code
- Mapstruct for conversions between domains
- WebClient: a reactive client HTTP
- SL4J for logging
- io.jsonwebtoken for JWT authentication
- JUnit 5 for unit tests
- Mockito
- Fixture Factory for generate fake objects
- Hamcrest for alternative asserts
- EasyRandom for generate randomic objects
- Wiremock for asserts with endpoints and http clients
- Clone the project
- Run the project:
$ mvn spring-boot:run
It's a RESTFull API for booking and searching a hotel with JWT authentication.
curl --request POST \
--url http://localhost:8080/auth \
--header 'Content-Type: application/json' \
--data '{
"user": "usuario",
"passwd": "senha"
}'
curl --request GET \
--url http://localhost:8080/booking/55/2022-08-27/2022-08-27/2/1 \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c3VhcmlvIiwiaXNzIjoidGVzdGVjdmMiLCJpYXQiOjE2NjE2NTM4MzMsImV4cCI6MTY2MTc0MDIzM30.daC15QAqKtpJRhSz-Y63Ul_bHOVZHCpJeZbZnx7JMjI'
curl --request GET \
--url http://localhost:8080/hotel/6 \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c3VhcmlvIiwiaXNzIjoidGVzdGVjdmMiLCJpYXQiOjE2NjE2NTM4MzMsImV4cCI6MTY2MTc0MDIzM30.daC15QAqKtpJRhSz-Y63Ul_bHOVZHCpJeZbZnx7JMjI'