|
|
@@ -2,7 +2,7 @@ package org.leumasjaffe.recipe.model;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
import static org.hamcrest.MatcherAssert.*;
|
|
|
-import static org.hamcrest.core.Is.*;
|
|
|
+import static org.hamcrest.collection.IsCollectionWithSize.*;
|
|
|
import static org.hamcrest.core.IsCollectionContaining.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
@@ -61,8 +61,7 @@ class CardTest {
|
|
|
final Step step = new Step();
|
|
|
step.setIngredients(Arrays.asList(new Ingredient("TEST", "", _1g)));
|
|
|
card.setCooking(Arrays.asList(step, step));
|
|
|
- // TODO Figure out why hamcrest-all isn't loading...
|
|
|
- assertThat(card.getIngredients().size(), is(1));
|
|
|
+ assertThat(card.getIngredients(), hasSize(1));
|
|
|
assertThat(card.getIngredients(),
|
|
|
hasItem(new Ingredient("TEST", "", new Amount("2 g"))));
|
|
|
}
|
|
|
@@ -75,8 +74,7 @@ class CardTest {
|
|
|
new Ingredient("TEST", "A", _1g),
|
|
|
new Ingredient("TEST", "B", _1g)));
|
|
|
card.setCooking(Arrays.asList(step));
|
|
|
- // TODO Figure out why hamcrest-all isn't loading...
|
|
|
- assertThat(card.getIngredients().size(), is(2));
|
|
|
+ assertThat(card.getIngredients(), hasSize(2));
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@@ -88,9 +86,9 @@ class CardTest {
|
|
|
new Ingredient("B", "TEST", _1g)));
|
|
|
card.setCooking(Arrays.asList(step));
|
|
|
card.setPreparation(new Preparation());
|
|
|
- assertThat(card.getIngredients().size(), is(2));
|
|
|
+ assertThat(card.getIngredients(), hasSize(2));
|
|
|
final Preparation prep = card.getPreparation().get();
|
|
|
- assertThat(prep.getIngredients().size(), is(1));
|
|
|
+ assertThat(prep.getIngredients(), hasSize(1));
|
|
|
assertThat(prep.getIngredients(), hasItem(new Ingredient("B", "TEST", _1g)));
|
|
|
}
|
|
|
}
|