### Question:
ProductService { @RequestMapping(value="/product/{id}", method = RequestMethod.GET ) Product getProduct(@PathVariable("id") int id) { Product prod = prodRepo.findOne(id); if (prod == null) throw new RuntimeException("No product for id " + id); else return prod ; }    }### Answer:
@Test public void getProduct() { ResponseEntity<Product> response = restTemplate.getForEntity("/product/1", Product.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals("Apples", response.getBody().getName()); }