Spring Boot, Mockito, Unit Testing, Junit 5, Rest Api.
Injecting Dependencies: @Mock private BooksRepository booksRepository; creates a mock version of BooksRepository, which is a dependency of BookService. @InjectMocks private BookServiceImpl bookService; creates an instance of BookServiceImpl and injects the mocked BooksRepository into it. Test Setup