@Test public void shouldSearch() { String searchParam = "supply"; String column = "name"; List<SupplyLine> supplyLines = asList(new SupplyLine()); Pagination pagination = new Pagination(2, 10); when(repository.search(searchParam, column, pagination)).thenReturn(supplyLines); List<SupplyLine> result = service.search(searchParam, column, pagination); assertThat(result, Is.is(supplyLines)); }
public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return repository.search(searchParam, column, pagination); }
SupplyLineService { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return repository.search(searchParam, column, pagination); } }
SupplyLineService { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return repository.search(searchParam, column, pagination); }  }
SupplyLineService { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return repository.search(searchParam, column, pagination); }  SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program); void save(SupplyLine supplyLine); SupplyLine getExisting(SupplyLine supplyLine); List<Facility> getSupplyingFacilities(Long userId); SupplyLine getById(Long id); List<SupplyLine> search(String searchParam, String column, Pagination pagination); Integer getTotalSearchResultCount(String searchParam, String column); SupplyLine getByFacilityProgram(Long facilityId, Long programId); }
SupplyLineService { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return repository.search(searchParam, column, pagination); }  SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program); void save(SupplyLine supplyLine); SupplyLine getExisting(SupplyLine supplyLine); List<Facility> getSupplyingFacilities(Long userId); SupplyLine getById(Long id); List<SupplyLine> search(String searchParam, String column, Pagination pagination); Integer getTotalSearchResultCount(String searchParam, String column); SupplyLine getByFacilityProgram(Long facilityId, Long programId);  }