Based on Spring Boot app template
Includes web-server on port 9080 with /api/v1/articles
endpoint exposed.
Supports CRUD set of operations and R with pagination
- Maven 3
- JDK 21
mvn clean install
docker build --no-cache ./ -t spring-boot-redis-app
Use run-in-docker.bat script
java -jar target/spring-boot-redis-0.0.1-SNAPSHOT.jar \
--spring.redis.host=localhost \
--spring.redis.port=6379
Same thing but using Spring profile to determine properties (Redis should be started before that manually):
java -jar target/spring-boot-redis-0.0.1-SNAPSHOT.jar \
--spring.profiles.active=dev
mvn spring-boot:run -Dspring-boot.run.arguments="\
--spring.redis.host=localhost \
--spring.redis.port=6379
Same thing but using Spring profile to determine properties (Redis should be started before that manually):
mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=dev
docker-compose up
http://localhost:9080/api/v1/articles
http://localhost:9080/swagger-ui/index.html
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "title": "Some tittle", "text": "Some text", "summary": "bla-bla", "author": "Pushkin" }' -X POST http://localhost:9080/api/v1/articles
curl -i http://localhost:9080/api/v1/articles/1
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "title": "Another tittle" }' -X PATCH http://localhost:9080/api/v1/articles/2
curl -i http://localhost:9080/api/v1/articles
curl -i 'http://localhost:9080/api/v1/articles?size=2&page=4&sort=author.firstName,DESC'
curl -i -X DELETE http://localhost:9080/api/v1/articles/1
cd func-test
./gradlew clean build
Check functional test report here