@Test public void shouldReturnSupplyLineBySupervisoryNodeAndProgram() { Program program = new Program(); SupervisoryNode supervisoryNode = new SupervisoryNode(); SupplyLine supplyLine = new SupplyLine(); when(repository.getSupplyLineBy(supervisoryNode, program)).thenReturn(supplyLine); SupplyLine returnedSupplyLine = service.getSupplyLineBy(supervisoryNode, program); verify(repository).getSupplyLineBy(supervisoryNode, program); assertThat(returnedSupplyLine, is(supplyLine)); }
public SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program) { return repository.getSupplyLineBy(supervisoryNode, program); }
SupplyLineService { public SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program) { return repository.getSupplyLineBy(supervisoryNode, program); } }
SupplyLineService { public SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program) { return repository.getSupplyLineBy(supervisoryNode, program); }  }
SupplyLineService { public SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program) { return repository.getSupplyLineBy(supervisoryNode, program); }  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 SupplyLine getSupplyLineBy(SupervisoryNode supervisoryNode, Program program) { return repository.getSupplyLineBy(supervisoryNode, program); }  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);  }