forked from pierront/mylibrary-template
Correction
This commit is contained in:
@@ -23,8 +23,9 @@ public final class BookRepository {
|
|||||||
|
|
||||||
public Book save(Book newBook) {
|
public Book save(Book newBook) {
|
||||||
for (Book book: books) {
|
for (Book book: books) {
|
||||||
if (book.getIsbn() == newBook.getIsbn()){
|
if (book.getIsbn().equals(newBook.getIsbn())){
|
||||||
books.remove(book);
|
books.remove(book);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.books.add(newBook);
|
this.books.add(newBook);
|
||||||
|
@@ -225,7 +225,6 @@ public class OrderSteps {
|
|||||||
assertTrue(isOrderOrBookNotFound,
|
assertTrue(isOrderOrBookNotFound,
|
||||||
"The exception should be of type OrderNotFoundException or BookNotFoundException. Exception réelle : " + exception.getClass().getName());
|
"The exception should be of type OrderNotFoundException or BookNotFoundException. Exception réelle : " + exception.getClass().getName());
|
||||||
String actualMessage = exception.getMessage();
|
String actualMessage = exception.getMessage();
|
||||||
System.out.println("[DEBUG] Exception message: '" + actualMessage + "'");
|
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
if (actualMessage != null) {
|
if (actualMessage != null) {
|
||||||
match = actualMessage.contains(errorMessage);
|
match = actualMessage.contains(errorMessage);
|
||||||
|
Reference in New Issue
Block a user