From ee80adc407a28695aa2b17d16a089ef2995fef29 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 9 Sep 2015 01:39:35 +0200 Subject: [PATCH] SpringJava REST: CarController, commit related to https://github.com/gumartinm/JavaScriptForFun/commit/ee9f818b18022b98b185cc1938a0302381c89329 --- SpringJava/REST/src/main/java/rest/CarController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SpringJava/REST/src/main/java/rest/CarController.java b/SpringJava/REST/src/main/java/rest/CarController.java index bb45725..4967da0 100644 --- a/SpringJava/REST/src/main/java/rest/CarController.java +++ b/SpringJava/REST/src/main/java/rest/CarController.java @@ -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)); } } -- 2.1.4