Spring Boot, Mockito, Unit Testing, Junit 5, Rest Api.
save_ReturnsInternalServerError() throws Exception { when(this.bookService.saveBook(any())).thenThrow(RuntimeException.class); ObjectMapper objectMapper = new ObjectMapper(); String content = objectMapper.writeValueAsString(books); this.mockMvc.perform(post("/api/v1/books")