Spring Boot, Mockito, Unit Testing, Junit 5, Rest Api.
return an Optional containing a book. Attempt to find a book by an ID that doesn’t exist, mocking findById to return Optional.empty(), simulating the case where the book is not found. Exception handling when finding a book by ID, by configuring the mock to throw a RuntimeException, testing the