PositionMasterService { public List<Position> getAllPositions() { return positionMasterRepository.findAll(); } @Autowired  PositionMasterService(final PositionMasterRepository positionMasterRepository); @Transactional void createPosition(final Position position); @Transactional void updatePosition(final Position position); @Transactional void deletePosition(final Position position); Position getPositionByName(final String name); Position getPositionById(final Long posId); List<Position> getAllPositions(); List<Position> getAllPositionsByNameLike(final String name); List<Position> getAllPositionsByDeptDesigId(final Long deptDesigId); List<Position> getPositionsForDeptDesigAndName(final Long departmentId, final Long designationId,
                                                          final Date fromDate, final Date toDate, final String posName); List<Position> getPositionsForDeptDesigAndNameLike(final Long departmentId, final Long designationId,
                                                              final String posName); boolean validatePosition(final Position position); List<Position> getPageOfPositions(final Long departmentId, final Long designationId); List<Position> findByNameContainingIgnoreCase(final String positionName); Integer getTotalOutSourcedPosts(final Long departmentId, final Long designationId); Integer getTotalSanctionedPosts(final Long departmentId, final Long designationId); List<Position> getPositionsByDepartmentAndDesignationForGivenRange(final Long departmentId,
                                                                              final Long designationId, final Date givenDate); List<Position> getPositionsByDepartmentAndDesignationId(Long departmentId, Long designationId); Position getCurrentPositionForUser(final Long userId); Position getSuperiorPositionByObjectTypeAndPositionFrom(final Integer objectId, final Long posId); Position getSuperiorPositionByObjectAndObjectSubTypeAndPositionFrom(final Integer objectId,
                                                                               final String objectSubType, final Long posId); List<Position> getPositionsForEmployee(final Long employeeId, final Date forDate); List<Position> getPositionsForEmployee(final Long employeeId); List<Position> getCurrentUserPositions(); Position getPositionByUserId(final Long userId); Position getPrimaryAssignmentPositionForEmp(final Long empId); String generatePositionByDeptDesig(final Department department, final Designation designation); List<Position> getPositionsByDepartment(final Long deptId); List<Position> getPositionsByDesignation(final Long desigId); List<Position> getPositionsByDepartmentAndDesignation(final Long deptId, final Long desigId);  }
@Test public void getAllPositions() { samplePosition(); List<Position> posList = positionMasterService.getAllPositions(); assertNotNull(posList); }