use of com.example.demo.dto.BookDto in project spring-boot-backend-template by paakmau.
the class BookServiceTests method testGetByTitle.
@Test
void testGetByTitle() {
for (Book book : books) {
Mockito.when(repo.findByTitle(book.getTitle())).thenReturn(Arrays.asList(book));
}
for (BookDto dto : bookDtos) {
List<BookDto> vos = service.getByTitle(dto.getTitle());
assertEquals(1, vos.size());
assertEquals(dto, vos.get(0));
}
}
Aggregations