@Test public void shouldGetUserSupervisedNodesInHierarchyByUserAndProgram() { Long userId = 1L; Long programId = 1L; supervisoryNodeService.getAllSupervisoryNodesInHierarchyBy(userId, programId, CREATE_REQUISITION); verify(supervisoryNodeRepository).getAllSupervisoryNodesInHierarchyBy(userId, programId, CREATE_REQUISITION); }
public List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames) { return supervisoryNodeRepository.getAllSupervisoryNodesInHierarchyBy(userId, programId, rightNames); }
SupervisoryNodeService { public List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames) { return supervisoryNodeRepository.getAllSupervisoryNodesInHierarchyBy(userId, programId, rightNames); } }
SupervisoryNodeService { public List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames) { return supervisoryNodeRepository.getAllSupervisoryNodesInHierarchyBy(userId, programId, rightNames); }  }
SupervisoryNodeService { public List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames) { return supervisoryNodeRepository.getAllSupervisoryNodesInHierarchyBy(userId, programId, rightNames); }  @Autowired void setPageSize(@Value("${search.page.size}") String pageSize); void save(SupervisoryNode supervisoryNode); List<SupervisoryNode> getSupervisoryNodesBy(Integer page, String nameSearchCriteria, Boolean parent); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, String... rightNames); SupervisoryNode getFor(Facility facility, Program program); User getApproverFor(Facility facility, Program program); SupervisoryNode getParent(Long id); User getApproverForGivenSupervisoryNodeAndProgram(SupervisoryNode supervisoryNode, Program program); List<SupervisoryNode> getAll(); List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode supervisoryNode); SupervisoryNode getByCode(SupervisoryNode supervisoryNode); Pagination getPagination(Integer page); Integer getTotalSearchResultCount(String param, Boolean parent); SupervisoryNode getSupervisoryNode(Long id); List<SupervisoryNode> getFilteredSupervisoryNodesByName(String param); List<SupervisoryNode> searchTopLevelSupervisoryNodesByName(String param); Long getTotalUnassignedSupervisoryNodeOfUserBy(Long userId, Long programId); }
SupervisoryNodeService { public List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames) { return supervisoryNodeRepository.getAllSupervisoryNodesInHierarchyBy(userId, programId, rightNames); }  @Autowired void setPageSize(@Value("${search.page.size}") String pageSize); void save(SupervisoryNode supervisoryNode); List<SupervisoryNode> getSupervisoryNodesBy(Integer page, String nameSearchCriteria, Boolean parent); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, String... rightNames); SupervisoryNode getFor(Facility facility, Program program); User getApproverFor(Facility facility, Program program); SupervisoryNode getParent(Long id); User getApproverForGivenSupervisoryNodeAndProgram(SupervisoryNode supervisoryNode, Program program); List<SupervisoryNode> getAll(); List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode supervisoryNode); SupervisoryNode getByCode(SupervisoryNode supervisoryNode); Pagination getPagination(Integer page); Integer getTotalSearchResultCount(String param, Boolean parent); SupervisoryNode getSupervisoryNode(Long id); List<SupervisoryNode> getFilteredSupervisoryNodesByName(String param); List<SupervisoryNode> searchTopLevelSupervisoryNodesByName(String param); Long getTotalUnassignedSupervisoryNodeOfUserBy(Long userId, Long programId);  }