BookReservationClientRest { public Reservation reserveBook(long bookId) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookId); HttpEntity<ReservationImpl> requestEntity = new HttpEntity<ReservationImpl>(reservationImpl, headers); ResponseEntity<ReservationImpl> response = restTemplate.postForEntity(URI.create("http: return response.getBody(); }  Reservation reserveBook(long bookId);  }
@Test public void testReserveBook() { Reservation reserveBook = bookReservationClientRest.reserveBook(1L); assertThat(reserveBook, notNullValue()); assertThat(reserveBook.getBookId(), is(1L)); }