From 5ef14ae5eec0a606e00ba25c42e8e3f3669cee66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Rasie=C5=84ski?= Date: Wed, 14 Jan 2026 19:54:56 +0100 Subject: [PATCH] Improved comments --- client/src/test/java/client/ServerUtilsMockTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/test/java/client/ServerUtilsMockTest.java b/client/src/test/java/client/ServerUtilsMockTest.java index 369c48c..57e3e42 100644 --- a/client/src/test/java/client/ServerUtilsMockTest.java +++ b/client/src/test/java/client/ServerUtilsMockTest.java @@ -69,6 +69,7 @@ class ServerUtilsMockTest { String inputJson = objectMapper.writeValueAsString(input); // Setup fake endpoint that returns empty list for getRecipes. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson("[]"))); // Setup fake endpoint that returns the input recipe when creating new recipe. @@ -105,6 +106,7 @@ class ServerUtilsMockTest { String recipesJson = objectMapper.writeValueAsString(recipes); // Setup fake endpoint that returns list with 1 recipe in it. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson(recipesJson))); // Our input to add. @@ -158,6 +160,7 @@ class ServerUtilsMockTest { String recipesJson = objectMapper.writeValueAsString(recipes); // Setup fake endpoint that returns list with 1 recipe in it. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson(recipesJson))); // Our input to add. @@ -189,6 +192,7 @@ class ServerUtilsMockTest { inputRecipe.setName(pre.getName()); // Reset name back to Steak without the (1) // Setup fake endpoint that returns list with 2 recipes in it. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson(recipesJson))); serverUtils.addRecipe(inputRecipe); @@ -234,6 +238,7 @@ class ServerUtilsMockTest { String verifyJson = objectMapper.writeValueAsString(generatedRecipe); // Setup fake endpoint that returns empty list for getRecipes. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson("[]"))); // Setup fake endpoint that returns the input recipe when creating new recipe. @@ -250,6 +255,7 @@ class ServerUtilsMockTest { @Test void findIdNotFoundTest() throws IOException, InterruptedException { // Setup fake endpoint that returns empty list for getRecipes. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipes")).willReturn(okJson("[]"))); assertThrows(IOException.class, () -> serverUtils.findId(1L)); @@ -267,6 +273,7 @@ class ServerUtilsMockTest { String recipeJson = objectMapper.writeValueAsString(recipe); // Setup fake endpoint that returns the recipe by id. + // urlPathEqualTo, because it ignores query params. stubFor(get(urlPathEqualTo("/api/recipe/"+recipe.getId())).willReturn(okJson(recipeJson))); Recipe found = serverUtils.findId(recipe.getId());