@Test public void shouldGetAllSupervisoryNodes() throws Exception { List<SupervisoryNode> expected = new ArrayList<>(); when(supervisoryNodeRepository.getAll()).thenReturn(expected); List<SupervisoryNode> actual = supervisoryNodeService.getAll(); verify(supervisoryNodeRepository).getAll(); assertThat(actual, is(expected)); }
public List<SupervisoryNode> getAll() { return supervisoryNodeRepository.getAll(); }
SupervisoryNodeService { public List<SupervisoryNode> getAll() { return supervisoryNodeRepository.getAll(); } }
SupervisoryNodeService { public List<SupervisoryNode> getAll() { return supervisoryNodeRepository.getAll(); }  }
SupervisoryNodeService { public List<SupervisoryNode> getAll() { return supervisoryNodeRepository.getAll(); }  @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> getAll() { return supervisoryNodeRepository.getAll(); }  @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);  }