| | |
| | | |
| | | import static org.junit.jupiter.api.Assertions.*; |
| | | import static org.mockito.ArgumentMatchers.any; |
| | | import static org.mockito.ArgumentMatchers.eq; |
| | | import static org.mockito.Mockito.*; |
| | | |
| | | class HrmAttendanceClockLocationTest { |
| | |
| | | when(holidayService.isWorkDay(any(LocalDate.class))).thenReturn(true); |
| | | HrmEmployeeDO employee = HrmEmployeeDO.builder().id(1L).deptId(2L).build(); |
| | | when(employeeService.getEmployee(1L)).thenReturn(employee); |
| | | when(ruleService.getAttendanceRuleByDeptId(2L)).thenReturn(requiredRule()); |
| | | when(ruleService.getAttendanceRuleByDeptId(eq(2L), any(LocalDate.class))).thenReturn(requiredRule()); |
| | | assertThrows(ServiceException.class, |
| | | () -> service.clockOut(1L, clockTime, position("0.00091", "20"), null)); |
| | | verify(mapper, never()).insert(any(HrmAttendanceRecordDO.class)); |