Skip to content
Snippets Groups Projects
Commit 4a9d6962 authored by Stian Lyng's avatar Stian Lyng
Browse files

bugfix: change return type in testGetByName

parent 5838bd59
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,6 @@ package ntnu.idatt2016.v233.SmartMat.repository; ...@@ -3,7 +3,6 @@ package ntnu.idatt2016.v233.SmartMat.repository;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import java.util.List; import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,9 +24,10 @@ public class RecipeRepositoryTest { ...@@ -25,9 +24,10 @@ public class RecipeRepositoryTest {
.build(); .build();
recipeRepository.save(recipe); recipeRepository.save(recipe);
Optional<Recipe> foundRecipe = recipeRepository.getByName("Pizza Margherita"); List<Recipe> foundRecipes = recipeRepository.getByName("Pizza Margherita");
assertTrue(foundRecipe.isPresent()); assertTrue(foundRecipes.isEmpty());
assertEquals(recipe.getName(), foundRecipe.get().getName()); assertEquals(1, foundRecipes.size());
assertEquals(recipe.getName(), foundRecipes.get(0).getName());
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment