diff --git a/rest-notes-spring-hateoas/src/main/java/com/example/notes/NotesController.java b/rest-notes-spring-hateoas/src/main/java/com/example/notes/NotesController.java index 033ecd2f..f937c2a0 100644 --- a/rest-notes-spring-hateoas/src/main/java/com/example/notes/NotesController.java +++ b/rest-notes-spring-hateoas/src/main/java/com/example/notes/NotesController.java @@ -95,10 +95,10 @@ public class NotesController { @RequestMapping(value = "/{id}/tags", method = RequestMethod.GET) ResourceSupport noteTags(@PathVariable("id") long id) { return new NestedContentResource( - this.tagResourceAssembler - .toResources(this.noteRepository.findById(id) - .orElseThrow(() -> new ResourceDoesNotExistException()) - .getTags())); + this.tagResourceAssembler.toResources(this.noteRepository + .findById(id) + .orElseThrow( + () -> new ResourceDoesNotExistException()).getTags())); } @RequestMapping(value = "/{id}", method = RequestMethod.PATCH) @@ -122,7 +122,7 @@ public class NotesController { return tagLocations .stream() .map(location -> this.tagRepository.findById(extractTagId(location)) - .orElseThrow( + . orElseThrow( () -> new IllegalArgumentException("The tag '" + location + "' does not exist"))) .collect(Collectors.toList());