@Test public void shouldSearchSupplyLines() throws Exception { String searchParam = "fac"; String column = "facility"; List<SupplyLine> supplyLines = asList(new SupplyLine()); Pagination pagination = new Pagination(2, 10); when(mapper.search(searchParam, column, pagination)).thenReturn(supplyLines); List<SupplyLine> result = repository.search(searchParam, column, pagination); assertThat(result, is(supplyLines)); verify(mapper).search(searchParam, column, pagination); }
public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return mapper.search(searchParam, column, pagination); }
SupplyLineRepository { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return mapper.search(searchParam, column, pagination); } }
SupplyLineRepository { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return mapper.search(searchParam, column, pagination); }  }
SupplyLineRepository { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return mapper.search(searchParam, column, pagination); }  void insert(SupplyLine supplyLine); SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program); void update(SupplyLine supplyLine); SupplyLine getById(Long id); List<SupplyLine> search(String searchParam, String column, Pagination pagination); Integer getTotalSearchResultCount(String searchParam, String column); List<Facility> getSupplyingFacilities(Long userId); SupplyLine getSupplyLineByFacilityProgram(Long facilityId, Long programId); }
SupplyLineRepository { public List<SupplyLine> search(String searchParam, String column, Pagination pagination) { return mapper.search(searchParam, column, pagination); }  void insert(SupplyLine supplyLine); SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program); void update(SupplyLine supplyLine); SupplyLine getById(Long id); List<SupplyLine> search(String searchParam, String column, Pagination pagination); Integer getTotalSearchResultCount(String searchParam, String column); List<Facility> getSupplyingFacilities(Long userId); SupplyLine getSupplyLineByFacilityProgram(Long facilityId, Long programId);  }