From 7a0a38dcdbf9f689bdc0d7536559619c8b24838b Mon Sep 17 00:00:00 2001 From: jerrrren Date: Fri, 31 Mar 2023 23:33:03 +0800 Subject: [PATCH 1/4] Refractor refresh --- .../commands/employee/DeleteCommand.java | 2 +- src/main/java/seedu/sudohr/model/Model.java | 6 +++ .../java/seedu/sudohr/model/ModelManager.java | 23 ++++++++-- src/main/java/seedu/sudohr/model/SudoHr.java | 42 +------------------ .../department/AddDepartmentCommandTest.java | 5 +++ .../AddEmployeeToDepartmentCommandTest.java | 5 +++ ...moveEmployeeFromDepartmentCommandTest.java | 6 +++ .../commands/employee/AddCommandTest.java | 5 +++ .../leave/AddEmployeeToLeaveCommandTest.java | 5 +++ .../AddEmployeeToLeaveFromToCommandTest.java | 5 +++ .../DeleteEmployeeFromLeaveCommandTest.java | 5 +++ 11 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/main/java/seedu/sudohr/logic/commands/employee/DeleteCommand.java b/src/main/java/seedu/sudohr/logic/commands/employee/DeleteCommand.java index 387607adcc2..11f8517b9a9 100644 --- a/src/main/java/seedu/sudohr/logic/commands/employee/DeleteCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/employee/DeleteCommand.java @@ -48,7 +48,7 @@ public CommandResult execute(Model model) throws CommandException { model.deleteEmployee(employeeToDelete); model.updateFilteredDepartmentList(Model.PREDICATE_SHOW_ALL_DEPARTMENTS); model.updateFilteredLeaveList(Model.PREDICATE_SHOW_ALL_NON_EMPTY_LEAVES); - + model.refresh(); return new CommandResult(String.format(MESSAGE_DELETE_EMPLOYEE_SUCCESS, employeeToDelete)); } diff --git a/src/main/java/seedu/sudohr/model/Model.java b/src/main/java/seedu/sudohr/model/Model.java index f8f035acbb6..240236687fd 100644 --- a/src/main/java/seedu/sudohr/model/Model.java +++ b/src/main/java/seedu/sudohr/model/Model.java @@ -286,4 +286,10 @@ public interface Model { * Deletes an employee {@code employee} from all leaves in SudoHR. */ void cascadeDeleteUserInLeaves(Employee employeeToDelete); + + + /** + * Refreshes filteredLists in SudoHr + */ + void refresh(); } diff --git a/src/main/java/seedu/sudohr/model/ModelManager.java b/src/main/java/seedu/sudohr/model/ModelManager.java index a6a0505eb06..c6cbbf3e157 100644 --- a/src/main/java/seedu/sudohr/model/ModelManager.java +++ b/src/main/java/seedu/sudohr/model/ModelManager.java @@ -32,6 +32,9 @@ public class ModelManager implements Model { private final FilteredList filteredEmployees; private final FilteredList filteredDepartments; private final FilteredList filteredLeaves; + private final FilteredList refreshedEmployees; + private final FilteredList refreshedDepartments; + private final FilteredList refreshedLeaves; private final SortedList sortedLeaves; /** @@ -45,9 +48,12 @@ public ModelManager(ReadOnlySudoHr sudoHr, ReadOnlyUserPrefs userPrefs) { this.sudoHr = new SudoHr(sudoHr); this.userPrefs = new UserPrefs(userPrefs); - filteredEmployees = new FilteredList<>(this.sudoHr.getEmployeeList()); - filteredDepartments = new FilteredList<>(this.sudoHr.getDepartmentList()); - filteredLeaves = new FilteredList<>(this.sudoHr.getLeavesList(), PREDICATE_SHOW_ALL_NON_EMPTY_LEAVES); + refreshedEmployees = new FilteredList<>(this.sudoHr.getEmployeeList(), (l) -> true); + refreshedDepartments = new FilteredList<>(this.sudoHr.getDepartmentList(), (l) -> true); + refreshedLeaves = new FilteredList<>(this.sudoHr.getLeavesList(), (l) -> true); + filteredEmployees = new FilteredList<>(refreshedEmployees); + filteredDepartments = new FilteredList<>(refreshedDepartments); + filteredLeaves = new FilteredList<>(refreshedLeaves, PREDICATE_SHOW_ALL_NON_EMPTY_LEAVES); sortedLeaves = new SortedList<>(this.filteredLeaves, new LeaveSortedByDateComparator()); } @@ -55,6 +61,7 @@ public ModelManager() { this(new SudoHr(), new UserPrefs()); } + // =========== UserPrefs // ================================================================================== @@ -91,6 +98,16 @@ public void setSudoHrFilePath(Path sudoHrFilePath) { userPrefs.setSudoHrFilePath(sudoHrFilePath); } + @Override + public void refresh() { + refreshedEmployees.setPredicate((e) -> false); + refreshedDepartments.setPredicate((d) -> false); + refreshedLeaves.setPredicate((l) -> false); + refreshedEmployees.setPredicate((e)->true); + refreshedDepartments.setPredicate((d)->true); + refreshedLeaves.setPredicate((l)->true); + } + // =========== SudoHr // ================================================================================ diff --git a/src/main/java/seedu/sudohr/model/SudoHr.java b/src/main/java/seedu/sudohr/model/SudoHr.java index c6036051ba0..899bf17cb7c 100644 --- a/src/main/java/seedu/sudohr/model/SudoHr.java +++ b/src/main/java/seedu/sudohr/model/SudoHr.java @@ -190,8 +190,6 @@ public void addEmployee(Employee employee) { public void setEmployee(Employee target, Employee editedEmployee) { requireNonNull(editedEmployee); employees.setEmployee(target, editedEmployee); - refreshDepartments(); - refreshLeaves(); } /** @@ -200,8 +198,6 @@ public void setEmployee(Employee target, Employee editedEmployee) { */ public void removeEmployee(Employee key) { employees.remove(key); - refreshDepartments(); - refreshLeaves(); } // =========== Department-Level Operations @@ -262,7 +258,6 @@ public void removeDepartment(Department key) { public void addEmployeeToDepartment(Employee p, Department d) { requireAllNonNull(p, d); d.addEmployee(p); - refreshDepartments(); } /** @@ -274,20 +269,8 @@ public void addEmployeeToDepartment(Employee p, Department d) { public void removeEmployeeFromDepartment(Employee p, Department d) { requireAllNonNull(p, d); d.removeEmployee(p); - refreshDepartments(); } - /** - * Refreshes the department list. - */ - public void refreshDepartments() { - UniqueDepartmentList currList = new UniqueDepartmentList(); - for (Department d : departments) { - currList.add(d); - } - departments.setDepartments(new UniqueDepartmentList()); - departments.setDepartments(currList); - } /** * Gets the number of employees in the specified department. @@ -312,8 +295,6 @@ public void cascadeDeleteEmployeeToDepartments(Employee employeeToDelete) { dept.removeEmployee(employeeToDelete); } } - refreshDepartments(); // defensive programming - refreshLeaves(); // defensive programming } /** @@ -329,8 +310,6 @@ public void cascadeEditEmployeeToDepartments(Employee employeeToEdit, Employee e dept.setEmployee(employeeToEdit, editedEmployee); } } - refreshDepartments(); // defensive programming - refreshLeaves(); // defensive programming } // =========== Leave-Level Operations @@ -377,8 +356,6 @@ public void addLeave(Leave leave) { */ public void deleteLeave(Leave leave) { leaves.remove(leave); - refreshDepartments(); - refreshLeaves(); } /** @@ -412,7 +389,7 @@ public boolean hasEmployeeOnLeave(LeaveDate date, Employee employee) { public void addEmployeeToLeave(Leave leave, Employee employee) { requireAllNonNull(leave, employee); leave.addEmployee(employee); - refreshLeaves(); + } /** @@ -421,19 +398,6 @@ public void addEmployeeToLeave(Leave leave, Employee employee) { public void deleteEmployeeFromLeave(Leave leave, Employee employee) { requireAllNonNull(leave, employee); leave.deleteEmployee(employee); - refreshLeaves(); - } - - /** - * Refreshes the leave list - */ - public void refreshLeaves() { - UniqueLeaveList currList = new UniqueLeaveList(); - for (Leave l : leaves) { - currList.addLeave(l); - } - leaves.setLeaves(new UniqueLeaveList()); - leaves.setLeaves(currList); } /** @@ -457,8 +421,6 @@ public void cascadeUpdateUserInLeaves(Employee employeeToEdit, Employee editedEm leave.setEmployee(employeeToEdit, editedEmployee); } } - refreshDepartments(); - refreshLeaves(); } /** @@ -471,8 +433,6 @@ public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { leave.deleteEmployee(employeeToDelete); } } - refreshDepartments(); - refreshLeaves(); } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/department/AddDepartmentCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/department/AddDepartmentCommandTest.java index ef2be47f63d..5715a17efdf 100644 --- a/src/test/java/seedu/sudohr/logic/commands/department/AddDepartmentCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/department/AddDepartmentCommandTest.java @@ -327,6 +327,11 @@ public void cascadeUpdateUserInLeaves(Employee employeeToEdit, Employee editedEm public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java index a9b22989fb6..77fe8f72a16 100644 --- a/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java @@ -350,6 +350,11 @@ public void cascadeUpdateUserInLeaves(Employee employeeToEdit, Employee editedEm public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java index ae052beb249..b89c7482d48 100644 --- a/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java @@ -348,6 +348,12 @@ public void cascadeUpdateUserInLeaves(Employee employeeToEdit, Employee editedEm public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + + } } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/employee/AddCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/employee/AddCommandTest.java index 82a4270871e..64f215d5534 100644 --- a/src/test/java/seedu/sudohr/logic/commands/employee/AddCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/employee/AddCommandTest.java @@ -387,6 +387,11 @@ public void cascadeUpdateUserInLeaves(Employee employeeToEdit, Employee editedEm public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java index 99ffb38b642..744fc5d183c 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java @@ -373,6 +373,11 @@ public boolean checkEmployeeExists(Id id) { throw new AssertionError("This method should not be called."); } + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } + } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java index 45b36a64f1c..fd63a416b19 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java @@ -400,6 +400,11 @@ public void cascadeEditEmployeeToDepartments(Employee employeeToEdit, Employee e public Leave getLeave(LeaveDate date) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } } /** diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java index b0534173a07..f09593a057e 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java @@ -338,6 +338,11 @@ public void cascadeDeleteUserInLeaves(Employee employeeToDelete) { public boolean checkEmployeeExists(Id id) { throw new AssertionError("This method should not be called."); } + + @Override + public void refresh() { + throw new AssertionError("This method should not be called."); + } } /** From 1045fdd4d3f2fcd479a98994056072e9f980960c Mon Sep 17 00:00:00 2001 From: jerrrren Date: Mon, 3 Apr 2023 10:10:37 +0800 Subject: [PATCH 2/4] Introduce defensive refresh --- .../commands/department/AddEmployeeToDepartmentCommand.java | 1 + .../sudohr/logic/commands/department/EditDepartmentCommand.java | 2 ++ .../department/RemoveEmployeeFromDepartmentCommand.java | 2 ++ .../sudohr/logic/commands/leave/AddEmployeeToLeaveCommand.java | 1 + .../logic/commands/leave/AddEmployeeToLeaveFromToCommand.java | 2 +- .../logic/commands/leave/DeleteEmployeeFromLeaveCommand.java | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommand.java b/src/main/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommand.java index 863ee5ff9cf..8a022accf1e 100644 --- a/src/main/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommand.java @@ -72,6 +72,7 @@ public CommandResult execute(Model model) throws CommandException { // show the employees within this department model.updateFilteredEmployeeList(e -> department.hasEmployee(e)); + model.refresh(); // defensive coding return new CommandResult(String.format(MESSAGE_ADD_EMPLOYEE_TO_DEPARTMENT_SUCCESS, employee, department)); } diff --git a/src/main/java/seedu/sudohr/logic/commands/department/EditDepartmentCommand.java b/src/main/java/seedu/sudohr/logic/commands/department/EditDepartmentCommand.java index 11142c6eb50..9bd95ce3868 100644 --- a/src/main/java/seedu/sudohr/logic/commands/department/EditDepartmentCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/department/EditDepartmentCommand.java @@ -66,6 +66,8 @@ public CommandResult execute(Model model) throws CommandException { model.setDepartment(departmentToEdit, editedDepartment); model.updateFilteredDepartmentList(Model.PREDICATE_SHOW_ALL_DEPARTMENTS); + model.refresh(); //defensive coding + return new CommandResult(String.format(MESSAGE_EDIT_DEPARTMENT_SUCCESS, editedDepartment)); } diff --git a/src/main/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommand.java b/src/main/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommand.java index eec8c04527d..4be1638cd64 100644 --- a/src/main/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommand.java @@ -73,6 +73,8 @@ public CommandResult execute(Model model) throws CommandException { // show the employees within this department model.updateFilteredEmployeeList(e -> department.hasEmployee(e)); + model.refresh(); // defensive coding + return new CommandResult(String.format(MESSAGE_REMOVE_EMPLOYEE_FROM_DEPARTMENT_SUCCESS, employee, department)); } diff --git a/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommand.java b/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommand.java index cf895885329..ac7a044508f 100644 --- a/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommand.java @@ -77,6 +77,7 @@ public CommandResult execute(Model model) throws CommandException { model.updateFilteredEmployeeList(predicate); final Leave leaveToFilter = leaveToAdd; model.updateFilteredLeaveList(l -> l.equals(leaveToFilter)); + model.refresh(); // defensive coding return new CommandResult(String.format(MESSAGE_ADD_LEAVE_SUCCESS, employeeToAdd, leaveToAdd)); } diff --git a/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommand.java b/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommand.java index 35cfbf7da7a..ab443ea01dc 100644 --- a/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommand.java @@ -92,7 +92,7 @@ public CommandResult execute(Model model) throws CommandException { final List leavesToFilter = leavesToAdd; model.updateFilteredLeaveList(l -> leavesToFilter.contains(l)); - + model.refresh(); // defensive coding return new CommandResult(builder.toString()); } diff --git a/src/main/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommand.java b/src/main/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommand.java index a8a56e8b4e2..6401ca10d33 100644 --- a/src/main/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommand.java @@ -74,6 +74,7 @@ public CommandResult execute(Model model) throws CommandException { final Leave leaveToFilter = leaveToDelete; model.updateFilteredLeaveList(l -> l.equals(leaveToFilter)); + model.refresh(); // defensive coding return new CommandResult(String.format(MESSAGE_SUCCESS, employeeToDelete, leaveToDelete)); } From 5e3000de102942ed05201c2e6e478cf96388887a Mon Sep 17 00:00:00 2001 From: jerrrren Date: Wed, 5 Apr 2023 14:41:53 +0800 Subject: [PATCH 3/4] Defensively refresh on edit --- .../java/seedu/sudohr/logic/commands/employee/EditCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/seedu/sudohr/logic/commands/employee/EditCommand.java b/src/main/java/seedu/sudohr/logic/commands/employee/EditCommand.java index e7a4ab6f3da..880e319f858 100644 --- a/src/main/java/seedu/sudohr/logic/commands/employee/EditCommand.java +++ b/src/main/java/seedu/sudohr/logic/commands/employee/EditCommand.java @@ -99,6 +99,7 @@ public CommandResult execute(Model model) throws CommandException { model.setEmployee(employeeToEdit, editedEmployee); model.updateFilteredEmployeeList(PREDICATE_SHOW_ALL_EMPLOYEES); model.updateFilteredLeaveList(Model.PREDICATE_SHOW_ALL_NON_EMPTY_LEAVES); // not req but defensive programming + model.refresh(); return new CommandResult(String.format(MESSAGE_EDIT_EMPLOYEE_SUCCESS, editedEmployee.toStringAllFields())); } From cef55bcf34664fbd16fbc297138ff06ff86b01c5 Mon Sep 17 00:00:00 2001 From: jerrrren Date: Wed, 5 Apr 2023 15:39:30 +0800 Subject: [PATCH 4/4] Resolve tests --- .../department/AddEmployeeToDepartmentCommandTest.java | 4 ++++ .../department/RemoveEmployeeFromDepartmentCommandTest.java | 4 ++++ .../logic/commands/leave/AddEmployeeToLeaveCommandTest.java | 4 ++++ .../commands/leave/AddEmployeeToLeaveFromToCommandTest.java | 4 ++++ .../commands/leave/DeleteEmployeeFromLeaveCommandTest.java | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java index 77fe8f72a16..e0f9aec3bc3 100644 --- a/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/department/AddEmployeeToDepartmentCommandTest.java @@ -409,5 +409,9 @@ public void updateFilteredEmployeeList(Predicate predicate) { public void updateFilteredDepartmentList(Predicate predicate) { } + + @Override + public void refresh() { + } } } diff --git a/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java index b89c7482d48..3407679698f 100644 --- a/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/department/RemoveEmployeeFromDepartmentCommandTest.java @@ -415,5 +415,9 @@ public void removeEmployeeFromDepartment(Employee p, Department d) { } + @Override + public void refresh() { + } + } } diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java index 744fc5d183c..e21dde08cf0 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveCommandTest.java @@ -476,5 +476,9 @@ public boolean checkEmployeeExists(Id id) { return sudoHr.checkEmployeeExists(id); } + @Override + public void refresh() { + } + } } diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java index fd63a416b19..79830efef50 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/AddEmployeeToLeaveFromToCommandTest.java @@ -497,6 +497,10 @@ public void updateFilteredEmployeeList(Predicate predicate) { public void updateFilteredLeaveList(Predicate predicateShowAllLeave) { } + @Override + public void refresh() { + } + @Override public boolean checkEmployeeExists(Id id) { requireNonNull(id); diff --git a/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java b/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java index f09593a057e..e2a6a5cd5b0 100644 --- a/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java +++ b/src/test/java/seedu/sudohr/logic/commands/leave/DeleteEmployeeFromLeaveCommandTest.java @@ -442,5 +442,9 @@ public boolean checkEmployeeExists(Id id) { return sudoHr.checkEmployeeExists(id); } + @Override + public void refresh() { + } + } }