chore(test/printExport): delegate creation to DefaultValueFactory
This commit is contained in:
parent
39b2bb9d61
commit
253da0b5bc
2 changed files with 9 additions and 7 deletions
|
|
@ -54,4 +54,10 @@ public class DefaultValueFactory {
|
||||||
defaultIngredient,
|
defaultIngredient,
|
||||||
"Some");
|
"Some");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static VagueIngredient getDefaultVagueIngredient(String name) {
|
||||||
|
return new VagueIngredient(
|
||||||
|
new Ingredient(name, 0., 0., 0.),
|
||||||
|
"Some");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
package client.scenes;
|
package client.scenes;
|
||||||
|
|
||||||
|
import client.utils.DefaultValueFactory;
|
||||||
import client.utils.PrintExportService;
|
import client.utils.PrintExportService;
|
||||||
import client.utils.ServerUtils;
|
import client.utils.ServerUtils;
|
||||||
import commons.Ingredient;
|
|
||||||
import commons.Recipe;
|
import commons.Recipe;
|
||||||
import commons.RecipeIngredient;
|
import commons.RecipeIngredient;
|
||||||
import commons.VagueIngredient;
|
|
||||||
import org.junit.jupiter.api.Assumptions;
|
import org.junit.jupiter.api.Assumptions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
@ -21,9 +20,6 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class PrintExportTest {
|
public class PrintExportTest {
|
||||||
static ServerUtils dv = new ServerUtils();
|
static ServerUtils dv = new ServerUtils();
|
||||||
private VagueIngredient getVague(String name) {
|
|
||||||
return new VagueIngredient(new Ingredient(name, 0., 0., 0.), "some");
|
|
||||||
}
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup(){
|
public void setup(){
|
||||||
Assumptions.assumeTrue(dv.isServerAvailable(), "Server not available");
|
Assumptions.assumeTrue(dv.isServerAvailable(), "Server not available");
|
||||||
|
|
@ -32,8 +28,8 @@ public class PrintExportTest {
|
||||||
@Test
|
@Test
|
||||||
public void buildRecipeTextTest(){
|
public void buildRecipeTextTest(){
|
||||||
List<RecipeIngredient> ingredients = new ArrayList<>();
|
List<RecipeIngredient> ingredients = new ArrayList<>();
|
||||||
ingredients.add(getVague("Banana"));
|
ingredients.add(DefaultValueFactory.getDefaultVagueIngredient("Banana"));
|
||||||
ingredients.add(getVague("Bread"));
|
ingredients.add(DefaultValueFactory.getDefaultVagueIngredient("Bread"));
|
||||||
final long testRecipeId = 1234L;
|
final long testRecipeId = 1234L;
|
||||||
List<String> preparationSteps = new ArrayList<>();
|
List<String> preparationSteps = new ArrayList<>();
|
||||||
preparationSteps.add("Mix Ingredients");
|
preparationSteps.add("Mix Ingredients");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue