@Test void whenDeletingAnNonExistingWord_return204() throws Exception { String wordId = UUID.randomUUID().toString(); MockHttpServletRequestBuilder delete = MockMvcRequestBuilders .delete(String.format("/words/%s", wordId)) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON); MockHttpServletResponse response = mockMvc.perform(delete).andReturn().getResponse(); assertThat(response.getStatus(), is(HttpStatus.NO_CONTENT.value())); }
@DeleteMapping("/{id}") public ResponseEntity<WordResponse> delete(@PathVariable UUID id) { LOGGER.info("Delete word with ID: {}", id); words.remove(id); return ResponseEntity.noContent().build(); }
WordController { @DeleteMapping("/{id}") public ResponseEntity<WordResponse> delete(@PathVariable UUID id) { LOGGER.info("Delete word with ID: {}", id); words.remove(id); return ResponseEntity.noContent().build(); } }
WordController { @DeleteMapping("/{id}") public ResponseEntity<WordResponse> delete(@PathVariable UUID id) { LOGGER.info("Delete word with ID: {}", id); words.remove(id); return ResponseEntity.noContent().build(); }  }
WordController { @DeleteMapping("/{id}") public ResponseEntity<WordResponse> delete(@PathVariable UUID id) { LOGGER.info("Delete word with ID: {}", id); words.remove(id); return ResponseEntity.noContent().build(); }  @PostMapping ResponseEntity<WordResponse> create(@Valid @RequestBody WordRequest request); @GetMapping("/{id}") ResponseEntity<WordResponse> read(@PathVariable UUID id); @PutMapping("/{id}") ResponseEntity<WordResponse> update(@PathVariable UUID id,
                                               @Valid @RequestBody WordRequest request); @DeleteMapping("/{id}") ResponseEntity<WordResponse> delete(@PathVariable UUID id); @DeleteMapping() ResponseEntity<WordResponse> deleteAll(); }
WordController { @DeleteMapping("/{id}") public ResponseEntity<WordResponse> delete(@PathVariable UUID id) { LOGGER.info("Delete word with ID: {}", id); words.remove(id); return ResponseEntity.noContent().build(); }  @PostMapping ResponseEntity<WordResponse> create(@Valid @RequestBody WordRequest request); @GetMapping("/{id}") ResponseEntity<WordResponse> read(@PathVariable UUID id); @PutMapping("/{id}") ResponseEntity<WordResponse> update(@PathVariable UUID id,
                                               @Valid @RequestBody WordRequest request); @DeleteMapping("/{id}") ResponseEntity<WordResponse> delete(@PathVariable UUID id); @DeleteMapping() ResponseEntity<WordResponse> deleteAll();  }