@Test public void shouldGetAllParentSupervisoryNodesInHierarchy() throws Exception { List<SupervisoryNode> expected = new ArrayList<>(); SupervisoryNode supervisoryNode = new SupervisoryNode(1L); when(supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(supervisoryNode)).thenReturn(expected); List<SupervisoryNode> actual = repository.getAllParentSupervisoryNodesInHierarchy(supervisoryNode); verify(supervisoryNodeMapper).getAllParentSupervisoryNodesInHierarchy(supervisoryNode); assertThat(actual, is(expected)); }
public List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node) { return supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(node); }
SupervisoryNodeRepository { public List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node) { return supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(node); } }
SupervisoryNodeRepository { public List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node) { return supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(node); } @Autowired  SupervisoryNodeRepository(SupervisoryNodeMapper supervisoryNodeMapper,
                                   FacilityRepository facilityRepository,
                                   RequisitionGroupRepository requisitionGroupRepository); }
SupervisoryNodeRepository { public List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node) { return supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(node); } @Autowired  SupervisoryNodeRepository(SupervisoryNodeMapper supervisoryNodeMapper,
                                   FacilityRepository facilityRepository,
                                   RequisitionGroupRepository requisitionGroupRepository); void insert(SupervisoryNode supervisoryNode); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames); Long getIdForCode(String code); Long getSupervisoryNodeParentId(Long supervisoryNodeId); SupervisoryNode getFor(Facility facility, Program program); SupervisoryNode getParent(Long id); List<SupervisoryNode> getAll(); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, String... rightNames); List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node); List<SupervisoryNode> getAllChildSupervisoryNodesInHierarchy(SupervisoryNode node); SupervisoryNode getByCode(SupervisoryNode supervisoryNode); void update(SupervisoryNode supervisoryNode); List<SupervisoryNode> getSupervisoryNodesByParent(Pagination pagination, String nameSearchCriteria); List<SupervisoryNode> getSupervisoryNodesBy(Pagination pagination, String nameSearchCriteria); Integer getTotalSearchResultCount(String param); Integer getTotalParentSearchResultCount(String param); SupervisoryNode getSupervisoryNode(Long id); List<SupervisoryNode> getFilteredSupervisoryNodesByName(String param); List<SupervisoryNode> searchTopLevelSupervisoryNodesByName(String param); Long getTotalUnassignedSupervisoryNodeOfUserBy(Long userId, Long programId); }
SupervisoryNodeRepository { public List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node) { return supervisoryNodeMapper.getAllParentSupervisoryNodesInHierarchy(node); } @Autowired  SupervisoryNodeRepository(SupervisoryNodeMapper supervisoryNodeMapper,
                                   FacilityRepository facilityRepository,
                                   RequisitionGroupRepository requisitionGroupRepository); void insert(SupervisoryNode supervisoryNode); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, Long programId, String... rightNames); Long getIdForCode(String code); Long getSupervisoryNodeParentId(Long supervisoryNodeId); SupervisoryNode getFor(Facility facility, Program program); SupervisoryNode getParent(Long id); List<SupervisoryNode> getAll(); List<SupervisoryNode> getAllSupervisoryNodesInHierarchyBy(Long userId, String... rightNames); List<SupervisoryNode> getAllParentSupervisoryNodesInHierarchy(SupervisoryNode node); List<SupervisoryNode> getAllChildSupervisoryNodesInHierarchy(SupervisoryNode node); SupervisoryNode getByCode(SupervisoryNode supervisoryNode); void update(SupervisoryNode supervisoryNode); List<SupervisoryNode> getSupervisoryNodesByParent(Pagination pagination, String nameSearchCriteria); List<SupervisoryNode> getSupervisoryNodesBy(Pagination pagination, String nameSearchCriteria); Integer getTotalSearchResultCount(String param); Integer getTotalParentSearchResultCount(String param); SupervisoryNode getSupervisoryNode(Long id); List<SupervisoryNode> getFilteredSupervisoryNodesByName(String param); List<SupervisoryNode> searchTopLevelSupervisoryNodesByName(String param); Long getTotalUnassignedSupervisoryNodeOfUserBy(Long userId, Long programId);  }