myRetail app for combining product information for the RedSky api with pricing information stored in the database.
- Spring Boot 2.1.0.RELEASE
- SpringFox (Swagger)
- Hystrix (Circuit Breaker)
- MongoDb
- groovy
- Mockito and Spock for testing
- Built using Intellij
MongoDb will need to be installed and running on port 27017 to run the app without config changes. An embedded instance was skipped due to the length of boot times it incurred.
gradlew clean run
When the project is opened with IntelliJ, there a config saved
in the repo call Run Application
. Run this to run the app.
http://localhost:9022/swagger-ui.html
curl -X GET "http://localhost:9022/api/v1/products/52272903"
{
"id": "52272903",
"name": "The LEGO Batman Movie (Blu-ray)",
"current_price": {
"value": 15,
"currency_code": "USD"
}
}
curl -X POST "http://localhost:9022/api/v1/products/13016243" -H "accept: */*" -H "Authorization: Any Old Auth Token" -H "Content-Type: application/json" -d "{ \"current_price\": { \"currency_code\": \"USD\", \"value\": 13.99 }, \"id\": \"13016243\"}"
Returns empty 200 response
curl -X PUT "http://localhost:9022/api/v1/products/13016243" -H "accept: */*" -H "Authorization: Any Old Auth Token" -H "Content-Type: application/json" -d "{ \"current_price\": { \"currency_code\": \"NZD\", \"value\": 0 }, \"id\": \"13016243\"}"
Returns empty 200 response
curl -X DELETE "http://localhost:9022/api/v1/products/13016243" -H "accept: */*" -H "Authorization: Any Old Auth Token"
Returns empty 200 response
Tests Run in gradle can be found in:
~/build/test-results/test/
gradlew test
or the Run All Unit Tests
run config in IntelliJ
Tests that run run against external APIs
gradlew extTest
or the Run All External Tests
run config in IntelliJ
End to End tests of the application
gradlew regressionTest
or the Run Regression Tests
run config in IntelliJ