Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring. :: spring-boot http://spring.io/guides/gs/rest-service/

123456789101112131415161718192021222324
  1. cd $(dirname $0)
  2. cd ../complete
  3. mvn clean package
  4. java -jar target/gs-rest-service-0.1.0.jar &
  5. PID=$!
  6. sleep 10
  7. curl -s http://localhost:8080/greeting > target/actual.json
  8. kill -9 $PID
  9. echo "Let's look at the actual results: `cat target/actual.json`"
  10. echo "And compare it to: `cat ../test/expected.json`"
  11. if diff -w ../test/expected.json target/actual.json
  12. then
  13. echo SUCCESS
  14. let ret=0
  15. else
  16. echo FAIL
  17. let ret=255
  18. fi
  19. rm -rf target
  20. exit $ret