AssignmentService { public Assignment getPrimaryAssignmentForUser(final Long userId) { return assignmentRepository.getPrimaryAssignmentForUser(userId); } @Autowired  AssignmentService(final AssignmentRepository assignmentRepository,
                             final HeadOfDepartmentsRepository employeeDepartmentRepository); Assignment getAssignmentById(final Long id); List<Assignment> getAllAssignmentsByEmpId(final Long empId); List<Assignment> getAllActiveEmployeeAssignmentsByEmpId(final Long empId); List<Assignment> getAssignmentsForPosition(final Long posId, final Date givenDate); Assignment getPrimaryAssignmentForPositon(final Long posId); @Transactional void createAssignment(final Assignment assignment); @Transactional void updateAssignment(final Assignment assignment); Assignment getPrimaryAssignmentForUser(final Long userId); Assignment getPrimaryAssignmentForEmployee(final Long empId); Assignment getPrimaryAssignmentForEmployeeByToDate(final Long empId, final Date toDate); List<Assignment> getAssignmentsForPosition(final Long posId); Boolean isHod(final Long assignId); Assignment getPrimaryAssignmentForPositionAndDate(final Long posId, final Date givenDate); Assignment getPrimaryAssignmentForGivenRange(final Long empId, final Date fromDate, final Date toDate); List<Assignment> getPositionsByDepartmentAndDesignationForGivenRange(final Long departmentId,
                                                                                final Long designationId, final Date givenDate); List<Assignment> getAllPositionsByDepartmentAndDesignationForGivenRange(final Long departmentId,
                                                                                   final Long designationId, final Date givenDate); List<Assignment> getAllPositionsByDepartmentAndPositionNameForGivenRange(final Long departmentId,
                                                                                    final String positionName); List<Assignment> getAssignmentsByDeptDesigAndDates(final Long deptId, final Long desigId,
                                                              final Date fromDate, final Date toDate); List<Assignment> findAllAssignmentsByDeptDesigAndDates(final Long deptId, final Long desigId,
                                                                  final Date givenDate); List<Assignment> findByEmployeeAndGivenDate(final Long empId, final Date givenDate); List<Assignment> findPrimaryAssignmentForDesignationName(final String name); List<Assignment> findByDesignationAndBoundary(final Long desigId, final Long boundaryId); List<Assignment> findByDepartmentDesignationAndBoundary(final Long deptId, final Long desigId,
                                                                   final Long boundaryId); List<Assignment> findByDeptDesgnAndParentAndActiveChildBoundaries(final Long deptId, final Long desigId,
                                                                             final Long boundaryId); List<Assignment> findAssignmentByDepartmentDesignationAndBoundary(final Long deptId, final Long desigId,
                                                                             final Long boundaryId); List<Assignment> getAssignmentsByDepartmentAndDesignationsAndBoundary(final Long deptId, final List<Long> desigIds,
                                                                                 final Long boundaryId); Set<Long> getRequiredBoundaries(final Long boundaryId); List<Assignment> getAllActiveAssignments(final Long designationId); @Transactional Employee removeDeletedAssignments(final Employee employee, final String removedAssignIds); Set<User> getUsersByDesignations(final String[] designationNames); Set<Role> getRolesForExpiredAssignmentsByEmpId(final Long empId); Set<Role> getRolesForActiveAssignmentsByEmpId(final Long empId); List<Assignment> findByDepartmentDesignationsAndGivenDate(final Long deptId, final List<Long> desigIds,
                                                                     final Date givenDate); List<Assignment> getAllAssignmentsByPositionNameForGivenRange(final String positionName); List<Position> findPositionsForEmployees(final String name); List<Employee> searchEmployeeAssignments(final EmployeeAssignmentSearch employeeAssignmentSearch); List<Assignment> getAssignmentList(final EmployeePositionSearch employeePositionSearch); List<Assignment> findAllAssignmentsByHODDeptAndDates(final Long deptId, final Date givenDate); List<Assignment> getAllAssignmentForEmployeeNameLike(final String empName); List<Assignment> findAssignmentForDepartmentId(final Long deptId); List<Assignment> findAssignmentForDesignationId(final Long desigId); List<Assignment> findByDepartmentAndDesignation(final Long deptId, final Long desigId); List<Assignment> getPrimaryAssignmentForPositionAndDateRange(final Long posId, final Date fromDate,
                                                                        final Date toDate); List<Assignment> getAssignmentByPositionAndUserAsOnDate(final Long posId, final Long userId, final Date currDate); List<Assignment> findByDepartmentCodeAndDesignationCode(String departmentCode, List<String> desigCodes); List<Designation> getDesignationsByActiveAssignmentAndDesignationNames(List<String> designationNames);  }
@Test public void getPrimaryAssignemntForUser() { Assignment assign = assignmentService.getPrimaryAssignmentForUser(1l); assertNotNull(assign); }