@Test public void shouldGetAllProgramProductsByProductCode() { List<ProgramProduct> expectedProgramProducts = new ArrayList<>(); when(programProductRepository.getByProductCode("code")).thenReturn(expectedProgramProducts); List<ProgramProduct> programProducts = service.getByProductCode("code"); assertThat(programProducts, is(expectedProgramProducts)); verify(programProductRepository).getByProductCode("code"); }
public List<ProgramProduct> getByProductCode(String productCode) { return programProductRepository.getByProductCode(productCode); }
ProgramProductService { public List<ProgramProduct> getByProductCode(String productCode) { return programProductRepository.getByProductCode(productCode); } }
ProgramProductService { public List<ProgramProduct> getByProductCode(String productCode) { return programProductRepository.getByProductCode(productCode); }  }
ProgramProductService { public List<ProgramProduct> getByProductCode(String productCode) { return programProductRepository.getByProductCode(productCode); }  Long getIdByProgramIdAndProductId(Long programId, Long productId); void updateProgramProductPrice(ProgramProductPrice programProductPrice); void save(ProgramProduct programProduct); void saveAndLogPriceChange(ProgramProduct programProduct); ProgramProduct getByProgramAndProductCode(ProgramProduct programProduct); ProgramProductPrice getProgramProductPrice(ProgramProduct programProduct); List<ProgramProduct> getByProgram(Program program); List<ProgramProduct> getByProductCode(String productCode); List<ProgramProduct> getProgramProductsBy(String programCode, String facilityTypeCode); List<ProgramProduct> getNonFullSupplyProductsForProgram(Program program); List<ProgramProduct> getActiveByProgram(Long programId); ProgramProduct getByProgramAndProductId(Long programId, Long productId); List<ProgramProduct> search(String searchParam, Pagination pagination, String column); List<ProgramProduct> getUnapprovedProgramProducts(Long facilityTypeId, Long programId); Integer getTotalSearchResultCount(String searchParam, String column); @Transactional void saveAll(List<ProgramProduct> programProducts, Product product); void insertISA(ProgramProductISA isa); void updateISA(ProgramProductISA isa); }
ProgramProductService { public List<ProgramProduct> getByProductCode(String productCode) { return programProductRepository.getByProductCode(productCode); }  Long getIdByProgramIdAndProductId(Long programId, Long productId); void updateProgramProductPrice(ProgramProductPrice programProductPrice); void save(ProgramProduct programProduct); void saveAndLogPriceChange(ProgramProduct programProduct); ProgramProduct getByProgramAndProductCode(ProgramProduct programProduct); ProgramProductPrice getProgramProductPrice(ProgramProduct programProduct); List<ProgramProduct> getByProgram(Program program); List<ProgramProduct> getByProductCode(String productCode); List<ProgramProduct> getProgramProductsBy(String programCode, String facilityTypeCode); List<ProgramProduct> getNonFullSupplyProductsForProgram(Program program); List<ProgramProduct> getActiveByProgram(Long programId); ProgramProduct getByProgramAndProductId(Long programId, Long productId); List<ProgramProduct> search(String searchParam, Pagination pagination, String column); List<ProgramProduct> getUnapprovedProgramProducts(Long facilityTypeId, Long programId); Integer getTotalSearchResultCount(String searchParam, String column); @Transactional void saveAll(List<ProgramProduct> programProducts, Product product); void insertISA(ProgramProductISA isa); void updateISA(ProgramProductISA isa);  }