Début de la feature avec des tests de base sur les variables #3

Open
Patrick FELIX-VIMALARATNAM wants to merge 19 commits from lebretonm/Projet_Pierront_Maxime_Marvin_Patrick:feature/RegisterNewBook into main
Showing only changes of commit 958f391b05 - Show all commits
@@ -0,0 +1,54 @@
package fr.iut_fbleau.but3.dev62.mylibrary.book.entity;
import fr.iut_fbleau.but3.dev62.mylibrary.book.BookDTO;
import fr.iut_fbleau.but3.dev62.mylibrary.book.converter.BookConverter;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import java.util.ArrayList;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class BookTest {
@Test
@DisplayName("Builder should create a valid Customer instance")
void testCustomerBuilder() {
String isbn = "1234567891012";
String title = "La vie de Maxime";
String author = "Marvin Aubert";
String editor = "Kioon";
LocalDate date = LocalDate.of(2026, 3, 24);
double price = 12.99;
Integer stock = 50;
ArrayList<String> categories = new ArrayList<>();
categories.add("Thriller");
categories.add("Biographie");
String description = "C'était un brave partit trop tôt";
String language = "Français";
Book book = Book.builder()
.isbn(isbn)
.title(title)
.author(author)
.editor(editor)
.date(date)
.price(price)
.stock(stock)
.categories(categories)
.description(description)
.language(language)
.build();
assertEquals(isbn, book.getIsbn());
assertEquals(title, book.getTitle());
assertEquals(author, book.getAuthor());
assertEquals(editor, book.getEditor());
assertEquals(date, book.getDate());
assertEquals(price, book.getPrice());
assertEquals(stock, book.getStock());
assertEquals(categories, book.getCategories());
assertEquals(description, book.getDescription());
assertEquals(language, book.getLanguage());
}
}