From 1273ae47fe37eb8e646b06dc7199805088647222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Rasie=C5=84ski?= Date: Fri, 21 Nov 2025 20:18:31 +0100 Subject: [PATCH] Expression lambdas --- commons/src/test/java/commons/RecipeTest.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/commons/src/test/java/commons/RecipeTest.java b/commons/src/test/java/commons/RecipeTest.java index e53ac58..97afd8b 100644 --- a/commons/src/test/java/commons/RecipeTest.java +++ b/commons/src/test/java/commons/RecipeTest.java @@ -42,16 +42,12 @@ class RecipeTest { @Test void getIngredientsAddThrow() { // TODO: Change to actual Ingredient class later - assertThrows(UnsupportedOperationException.class, () -> { - recipe.getIngredients().add("Lasagna"); - }); + assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().add("Lasagna")); } @Test void getIngredientsClearThrow() { - assertThrows(UnsupportedOperationException.class, () -> { - recipe.getIngredients().clear(); - }); + assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().clear()); } @Test @@ -66,16 +62,12 @@ class RecipeTest { @Test void getPreparationStepsAddThrow() { - assertThrows(UnsupportedOperationException.class, () -> { - recipe.getPreparationSteps().add("Preheat Oven"); - }); + assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().add("Preheat Oven")); } @Test void getPreparationStepsClearThrow() { - assertThrows(UnsupportedOperationException.class, () -> { - recipe.getPreparationSteps().clear(); - }); + assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().clear()); } @Test