Update ApproveRecipeInteractorTest.java#174
Conversation
| private static class TestApproveRecipeDAO implements ApproveRecipeDataAccessInterface { | ||
| private List<Recipe> availableRecipes = new ArrayList<>(); | ||
| private Map<String, User> users = new HashMap<>(); | ||
| private boolean shouldThrowOnGetRecipes = false; |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'shouldThrowOnGetRecipes' explicitly initialized to 'false' (default value for its type).
| private List<Recipe> availableRecipes = new ArrayList<>(); | ||
| private Map<String, User> users = new HashMap<>(); | ||
| private boolean shouldThrowOnGetRecipes = false; | ||
| private boolean shouldThrowOnSave = false; |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'shouldThrowOnSave' explicitly initialized to 'false' (default value for its type).
| private Map<String, User> users = new HashMap<>(); | ||
| private boolean shouldThrowOnGetRecipes = false; | ||
| private boolean shouldThrowOnSave = false; | ||
| private boolean shouldThrowOnRemove = false; |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck> reported by reviewdog 🐶
Variable 'shouldThrowOnRemove' explicitly initialized to 'false' (default value for its type).
| public TestApproveRecipeDAO() { | ||
| // Create test user | ||
| User testUser = new User("testUser", "password", new ArrayList<>(), | ||
| User testUser = new User("testUser", "password", new ArrayList<>(), |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'testUser' should be declared final.
| assertEquals(0, dao.getUser("testUser").getSavedRecipes().size()); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.
| @Test | ||
| void testApproveRecipeInputDataGetters() { | ||
| // Create input data and verify getters | ||
| ApproveRecipeInputData inputData = new ApproveRecipeInputData(123, "testUser"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'inputData' should be declared final.
| assertEquals("testUser", inputData.getUsername()); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.
| @Test | ||
| void testDeclineRecipeInputDataGetters() { | ||
| // Create input data and verify getters | ||
| DeclineRecipeInputData inputData = new DeclineRecipeInputData(456, "testUser"); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'inputData' should be declared final.
| assertEquals("testUser", inputData.getUsername()); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck> reported by reviewdog 🐶
Init blocks, constructors, fields and methods should be before inner types.
| @Test | ||
| void testApproveRecipeOutputDataCurrentIndexAfterApproval() { | ||
| // Setup | ||
| List<Recipe> recipes = new ArrayList<>(); |
There was a problem hiding this comment.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck> reported by reviewdog 🐶
Variable 'recipes' should be declared final.
Adish-Singh
left a comment
There was a problem hiding this comment.
These tests have 100% line coverage, so good job.
No description provided.