Spring Boot, Mockito, Unit Testing, Junit 5, Rest Api.
MessageFormat.format("Exception while fetching book with id: {0}", id)); } } } Long story short, the code given above has “saving of book”, “fetch book By Id” functionalities. The service layer has got an additional functionality of “fetching all books” but this not called in controllers