SpringJava REST: CarController, commit related to
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 8 Sep 2015 23:39:35 +0000 (01:39 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 8 Sep 2015 23:39:35 +0000 (01:39 +0200)
https://github.com/gumartinm/JavaScriptForFun/commit/ee9f818b18022b98b185cc1938a0302381c89329

SpringJava/REST/src/main/java/rest/CarController.java

index bb45725..4967da0 100644 (file)
@@ -33,6 +33,13 @@ public class CarController {
     @RequestMapping(value = "/{id}", produces = { "application/json" }, method = RequestMethod.GET)
     @ResponseStatus(HttpStatus.OK)
     public Car car(@PathVariable("id") long id) {
+        try {
+            Thread.sleep(10000);                 //1000 milliseconds is one second.
+        } catch(InterruptedException ex) {
+            Thread.currentThread().interrupt();
+        }
+
+
         return new Car(counter.incrementAndGet(), String.format(template, id));
     }
 }