Microservice to consult prices
To run the microservice you must first make sure that your port 8080 is not in use. Then navigate in the console to the project folder and launch the following command.
$mvn clean install && docker-compose up
After executing the command indicated in the previous section, all the tests will have been executed and the coverage report generated. However, if we wish to generate it again, we would only have to use the following command.
$mvn verify
To access the coverage report you only have to access the folder
./target/site/jacoco/index.html
and open the file index.html with the browser of your preference.
You can consult the swagger in http://localhost:8080/swagger-ui.html , the file "swagger.json" or in SwaggerHub https://app.swaggerhub.com/apis/fernandoris/PriceProductOnDate/1.0.0
Once the microservice is up, to run the tests you can import the postman collection in the file PriceProductOndate.postman_collection.json
or execute the following commands in the console
curl --location --request GET 'http://localhost:8080/prices?date=2020-06-14-10.00.34&productId=35455&brandId=1'
curl --location --request GET 'http://localhost:8080/prices?date=2020-06-14-16.00.34&productId=35455&brandId=1'
curl --location --request GET 'http://localhost:8080/prices?date=2020-06-14-21.00.34&productId=35455&brandId=1'
curl --location --request GET 'http://localhost:8080/prices?date=2020-06-15-10.00.34&productId=35455&brandId=1'
curl --location --request GET 'http://localhost:8080/prices?date=2020-06-16-21.00.34&productId=35455&brandId=1'