forked from pierront/mylibrary-template
J'avais oublié des customer dans book
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package fr.iut_fbleau.but3.dev62.mylibrary.book.usecase;
|
||||
|
||||
import fr.iut_fbleau.but3.dev62.mylibrary.customer.CustomerInfo;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
@@ -21,7 +20,7 @@ import static org.mockito.Mockito.*;
|
||||
public class BookUseCaseTest {
|
||||
|
||||
@Mock
|
||||
private BookRepository customerRepository;
|
||||
private BookRepository bookRepository;
|
||||
|
||||
@InjectMocks
|
||||
private BookUseCase bookUseCase;
|
||||
@@ -47,7 +46,7 @@ public class BookUseCaseTest {
|
||||
.language("Francais")
|
||||
.build();
|
||||
|
||||
validBookInfo = new CustomerInfo("LivreRandom", "John Doe", "RandomPublisher", date, 12.5, 50, cat, "Je suis un livre qui est composé de mots.", "Francais");
|
||||
validBookInfo = new BookInfo("LivreRandom", "John Doe", "RandomPublisher", date, 12.5, 50, cat, "Je suis un livre qui est composé de mots.", "Francais");
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +56,7 @@ public class BookUseCaseTest {
|
||||
public class RegisterBookTests {
|
||||
|
||||
@Test
|
||||
@DisplayName("Should register customer when valid data is provided")
|
||||
@DisplayName("Should register book when valid data is provided")
|
||||
void testRegisterBookWithValidData() throws NotValidBookException {
|
||||
when(BookRepository.save(any(Book.class))).thenReturn(testBook);
|
||||
|
||||
@@ -69,7 +68,7 @@ public class BookUseCaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Should throw exception when customer data is not valid")
|
||||
@DisplayName("Should throw exception when book data is not valid")
|
||||
void testRegisterBookWithInvalidData() {
|
||||
BookInfo invalidBookInfo = new BookInfo("", "", "");
|
||||
|
||||
@@ -86,7 +85,7 @@ public class BookUseCaseTest {
|
||||
|
||||
|
||||
@Nested
|
||||
@DisplayName("Find customer tests")
|
||||
@DisplayName("Find book tests")
|
||||
class FindBookTests {
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user