This repository shows you how I was putting in practice my knowledge about Spring Boot...
I propose myself write a REST API with Spring Boot, and reach the 100% of test coverage.
Here I wrote from 0 a Secure Notes APP API & 100% Tested, this also save all exceptions
in a log file, also the authentication failures & the successful...
Due to the fact that I implemented this with basic authentication, I won't document widely the API...
The unique documentation that I implemented is with SpringDoc OpenAPI, you can see the API documentation in the following URL:
http://localhost:8080/docs/swagger-ui.html
You need run the API to see the documentation...
-
Create a local DB in PostgresSQL:
port:5432database:api-rest-spring-bootschema:tests: used for the testspublic: used for the app in production mode
-
Add the Environment variables:
PSQL_PASS: password of the user which has the grants for theapi-rest-spring-bootdatabasePSQL_USER: username of the user which has the grants for theapi-rest-spring-bootdatabase
-
Verify the above:
echo $PSQL_USER && echo $PSQL_PASS: if you see the credentials, then you can continuepsql -h localhost -p 5432 -U $PSQL_USER -d api-rest-spring-boot -c "SELECT schema_name FROM information_schema.schemata;": if you can see the schematests&&public, then you can continue.
-
JDK:
21
Dockerize this API is in my TODO list...