Spring Boot, Mockito, Unit Testing, Junit 5, Rest Api.
} @Override public Books findById(String id) throws Exception{ Books books = Books.builder().build(); try{ Optional<Books> optionalBooks = this.booksRepository.findById(id); if(optionalBooks.isPresent()){ books = optionalBooks.get(); return books; }else { return optionalBooks.orElse(books); }