@Test public void deleteBook() throws Exception { bookRepository.save(book); restBookMockMvc.perform(delete("/app/rest/books/{id}", book.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); List<Book> books = bookRepository.findAll(); assertThat(books).hasSize(0); }
@RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public void delete(@PathVariable String id) { log.debug("REST request to delete Book : {}", id); bookRepository.delete(id); }
BookResource { @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public void delete(@PathVariable String id) { log.debug("REST request to delete Book : {}", id); bookRepository.delete(id); } }
BookResource { @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public void delete(@PathVariable String id) { log.debug("REST request to delete Book : {}", id); bookRepository.delete(id); }  }
BookResource { @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public void delete(@PathVariable String id) { log.debug("REST request to delete Book : {}", id); bookRepository.delete(id); }  @RequestMapping(value = "/rest/books", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void create(@RequestBody Book book); @RequestMapping(value = "/rest/books", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed List<Book> getAll(); @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed ResponseEntity<Book> get(@PathVariable String id); @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void delete(@PathVariable String id); }
BookResource { @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public void delete(@PathVariable String id) { log.debug("REST request to delete Book : {}", id); bookRepository.delete(id); }  @RequestMapping(value = "/rest/books", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void create(@RequestBody Book book); @RequestMapping(value = "/rest/books", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed List<Book> getAll(); @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed ResponseEntity<Book> get(@PathVariable String id); @RequestMapping(value = "/rest/books/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void delete(@PathVariable String id);  }