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());