Skip to content

last changes#173

Merged
Adish-Singh merged 1 commit intomainfrom
use-case-5-comments
Dec 2, 2025
Merged

last changes#173
Adish-Singh merged 1 commit intomainfrom
use-case-5-comments

Conversation

@Klyvux
Copy link
Copy Markdown
Collaborator

@Klyvux Klyvux commented Dec 2, 2025

added comments to search by ing files
added tests to liked recipe list

added tests to liked recipe list
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

checkstyle

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'lastSavedRecipe' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'liked' should be declared final.

List<Recipe> liked = likedByUser.computeIfAbsent(username, u -> new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck> reported by reviewdog 🐶
Name 'u' must match pattern '^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$'.

List<Recipe> liked = likedByUser.computeIfAbsent(username, u -> new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'liked' should be declared final.

List<Recipe> liked = likedByUser.get(username);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck> reported by reviewdog 🐶
Name 'r' must match pattern '^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$'.

liked.removeIf(r -> r.getRecipeId() == recipeId);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck> reported by reviewdog 🐶
Return count is 3 (max allowed for non-void methods/lambdas is 1).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'liked' should be declared final.

List<Recipe> liked = likedByUser.get(username);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'u' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck> reported by reviewdog 🐶
Class FakePresenter should be declared as final.

private static class FakePresenter implements LikedRecipeOutputBoundary {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'lastOutput' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'lastHandsfreeInput' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'lastError' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'likedViewCalls' explicitly initialized to '0' (default value for its type).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'likedViewCalls' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'handsfreeCalls' explicitly initialized to '0' (default value for its type).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'handsfreeCalls' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'failCalls' explicitly initialized to '0' (default value for its type).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'failCalls' must be private and have accessor methods.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.

private Recipe newRecipe(int id, String name, List<Ingredient> ingredients) {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutr' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.

private LikedRecipeInputData inputFor(int id) {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_successNewRecipe' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addLikedRecipe_successNewRecipe() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe' should be declared final.

Recipe recipe = newRecipe(1, "R1", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

assertNotNull(presenter.lastOutput); // from loadLikedRecipes()


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_recipeNotFound' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_userNotFound' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe' should be declared final.

Recipe recipe = newRecipe(1, "R1", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_alreadySaved' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe' should be declared final.

Recipe recipe = newRecipe(1, "R1", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

user.getSavedRecipes().add(recipe); // already saved


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_exceptionHandled' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addLikedRecipe_exceptionHandled() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'deleteLikedRecipe_success' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 5, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'r1' should be declared final.

Recipe r1 = newRecipe(1, "R1", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'r2' should be declared final.

Recipe r2 = newRecipe(2, "R2", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

assertNotNull(presenter.lastOutput); // from loadLikedRecipes()


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'deleteLikedRecipe_userNotFound' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void deleteLikedRecipe_userNotFound() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'deleteLikedRecipe_exceptionHandled' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void deleteLikedRecipe_exceptionHandled() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'loadLikedRecipes_populatesOutput' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void loadLikedRecipes_populatesOutput() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'dao' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 6, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'ingredients' should be declared final.

List<Ingredient> ingredients = new ArrayList<>();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'r1' should be declared final.

Recipe r1 = newRecipe(10, "Pizza", ingredients);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'out' should be declared final.

LikedRecipeOutputData out = presenter.lastOutput;


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'ingStrings' should be declared final.

List<String[]> ingStrings = out.getRecipeIngredients().get(0);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'loadLikedRecipes_exceptionHandled' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void loadLikedRecipes_exceptionHandled() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'handsfree_success' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'result' should be declared final.

List<InstructionStep> result = interactor.handsfree(inputFor(123));


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'instructions' should be declared final.

RecipeInstructions instructions = presenter.lastHandsfreeInput.instructions();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'handsfree_exceptionHandled' must match pattern '^[a-z][a-zA-Z0-9]*$'.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'result' should be declared final.

List<InstructionStep> result = interactor.handsfree(inputFor(123));


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_recipeNotFound' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_recipeNotFound() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_noIngredients' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_noIngredients() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe' should be declared final.

Recipe recipe = newRecipe(10, "Empty", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_success' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_success() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'dao' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 6, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'ing' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipe' should be declared final.

Recipe recipe = newRecipe(10, "WithIngredients", ing);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

assertEquals(1, presenter.likedViewCalls); // from loadLikedRecipes()


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_exceptionHandled' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_exceptionHandled() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addLikedRecipe_alreadyHasDifferentRecipeId' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addLikedRecipe_alreadyHasDifferentRecipeId() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'existing' should be declared final.

Recipe existing = newRecipe(99, "Other", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'newOne' should be declared final.

Recipe newOne = newRecipe(1, "New", new ArrayList<>());


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

assertNotNull(presenter.lastOutput); // loadLikedRecipes called


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_nonMatchingRecipeIdInList' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_nonMatchingRecipeIdInList() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 5, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'ing' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'r' should be declared final.

Recipe r = newRecipe(5, "SomeRecipe", ing); // ID 5


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck> reported by reviewdog 🐶
Don't use trailing comments.

Recipe r = newRecipe(5, "SomeRecipe", ing); // ID 5


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'addIngredientsToGrocery_ingredientsNull' must match pattern '^[a-z][a-zA-Z0-9]*$'.

public void addIngredientsToGrocery_ingredientsNull() {


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'dao' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck> reported by reviewdog 🐶
Distance between variable 'presenter' declaration and its first usage is 5, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'presenter' should be declared final.

FakePresenter presenter = new FakePresenter();


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'user' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'nutr' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipeWithNullIngredients' should be declared final.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'interactor' should be declared final.

LikedRecipeInteractor interactor = new LikedRecipeInteractor(dao, presenter);


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.


🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
Summary javadoc is missing.

@@ -0,0 +1,596 @@
package use_case.liked_recipe_list;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck> reported by reviewdog 🐶
Name 'use_case.liked_recipe_list' must match pattern '^[a-z]+(.[a-zA-Z_]\w*)*$'.

import entities.Recipe;
import entities.RecipeInstructions;
import entities.User;
import org.junit.Test;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck> reported by reviewdog 🐶
Import statement for 'org.junit.Test' is in the wrong order. Should be in the 'THIRD_PARTY_PACKAGE' group, expecting not assigned imports on this line.

import entities.Recipe;
import entities.RecipeInstructions;
import entities.User;
import org.junit.Test;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.junit.Test' import.

import entities.RecipeInstructions;
import entities.User;
import org.junit.Test;
import use_case.step_by_step.StepByStepInputData;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
'use_case.step_by_step.StepByStepInputData' should be separated from previous imports.

import org.junit.Test;
import use_case.step_by_step.StepByStepInputData;

import java.util.*;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck> reported by reviewdog 🐶
Import statement for 'java.util.*' is in the wrong order. Should be in the 'STANDARD_JAVA_PACKAGE' group, expecting not assigned imports on this line.

// Flags to force exceptions
boolean throwOnGetCurrentUsername = false;
boolean throwOnGetLikedRecipes = false;
boolean throwOnGetAnalyzedInstructions = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'throwOnGetAnalyzedInstructions' explicitly initialized to 'false' (default value for its type).

// Flags to force exceptions
boolean throwOnGetCurrentUsername = false;
boolean throwOnGetLikedRecipes = false;
boolean throwOnGetAnalyzedInstructions = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'throwOnGetAnalyzedInstructions' must be private and have accessor methods.

boolean throwOnGetCurrentUsername = false;
boolean throwOnGetLikedRecipes = false;
boolean throwOnGetAnalyzedInstructions = false;
boolean throwOnGetLikedRecipesInGrocery = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'throwOnGetLikedRecipesInGrocery' explicitly initialized to 'false' (default value for its type).

boolean throwOnGetCurrentUsername = false;
boolean throwOnGetLikedRecipes = false;
boolean throwOnGetAnalyzedInstructions = false;
boolean throwOnGetLikedRecipesInGrocery = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'throwOnGetLikedRecipesInGrocery' must be private and have accessor methods.

boolean throwOnGetLikedRecipesInGrocery = false;

// For addLikedRecipe save tracking
String lastSavedUsername;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'lastSavedUsername' must be private and have accessor methods.

Copy link
Copy Markdown
Collaborator

@Adish-Singh Adish-Singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding the comments. The tests have 100% line coverage so great job.

@Adish-Singh Adish-Singh merged commit 060db51 into main Dec 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants