This Product API has been built using Java 10, Spring Boot, Spring Cloud Feign, Swagger, Lombok, Junit5 and Docker.
To run the project execute from the project root
docker-compose up
This will pull the pre-built images from Docker Hub and run it in docker.
Navigate to: http://localhost:8080/swagger-ui.html to access the API through SWAGGER
Endpoint | Description |
---|---|
GET /products | Get products. Query parameter 'priceLabel' can be specified with possible values: 'ShowWasNow' or 'ShowWasThenNow' or 'ShowPercDscount' |
You can run all unit and integration tests by executing from the project root
mvn clean verify
Note that sometimes the external API can go down so integration tests may fail or application is not able to retrieve any data
A run.sh Bash script has been written to provide useful commands for the project. It is executed in the following way:
./run.sh {build|start|stop|run|push|logs}
-
build: build the application
-
start: start the docker containers
-
stop: stop and remove the docker containers
-
run: build and start
-
push: push the images to Docker Hub
-
logs: shows log output from docker containers