@Test public void shouldGetProgramProductsByProgram() { Program program = new Program(); List<ProgramProduct> expectedProgramProducts = new ArrayList<>(); when(programProductMapper.getByProgram(program)).thenReturn(expectedProgramProducts); List<ProgramProduct> programProducts = programProductRepository.getByProgram(program); verify(programProductMapper).getByProgram(program); assertThat(programProducts, is(expectedProgramProducts)); }
public List<ProgramProduct> getByProgram(Program program) { return mapper.getByProgram(program); }
ProgramProductRepository { public List<ProgramProduct> getByProgram(Program program) { return mapper.getByProgram(program); } }
ProgramProductRepository { public List<ProgramProduct> getByProgram(Program program) { return mapper.getByProgram(program); }  }
ProgramProductRepository { public List<ProgramProduct> getByProgram(Program program) { return mapper.getByProgram(program); }  void save(ProgramProduct programProduct); Long getIdByProgramIdAndProductId(Long programId, Long productId); void updateCurrentPrice(ProgramProduct programProduct); ProgramProduct getByProgramAndProductCode(ProgramProduct programProduct); ProgramProduct getByProgramAndProductId(Long programId, Long productId); void updatePriceHistory(ProgramProductPrice programProductPrice); void updateProgramProduct(ProgramProduct programProduct); ProgramProductPrice getProgramProductPrice(ProgramProduct programProduct); List<ProgramProduct> getByProgram(Program program); ProgramProduct getById(Long id); List<ProgramProduct> getByProductCode(String code); List<ProgramProduct> getProgramProductsBy(Long programId, String facilityTypeCode); List<ProgramProduct> getNonFullSupplyProductsForProgram(Program program); List<ProgramProduct> searchByProgram(String searchParam, Pagination pagination); Integer getTotalSearchResultCount(String searchParam); List<ProgramProduct> searchByProduct(String searchParam, Pagination pagination); List<ProgramProduct> getActiveByProgram(Long programId); @Transactional void insertISA(ProgramProductISA programProductISA); void updateISA(ProgramProductISA programProductISA); }
ProgramProductRepository { public List<ProgramProduct> getByProgram(Program program) { return mapper.getByProgram(program); }  void save(ProgramProduct programProduct); Long getIdByProgramIdAndProductId(Long programId, Long productId); void updateCurrentPrice(ProgramProduct programProduct); ProgramProduct getByProgramAndProductCode(ProgramProduct programProduct); ProgramProduct getByProgramAndProductId(Long programId, Long productId); void updatePriceHistory(ProgramProductPrice programProductPrice); void updateProgramProduct(ProgramProduct programProduct); ProgramProductPrice getProgramProductPrice(ProgramProduct programProduct); List<ProgramProduct> getByProgram(Program program); ProgramProduct getById(Long id); List<ProgramProduct> getByProductCode(String code); List<ProgramProduct> getProgramProductsBy(Long programId, String facilityTypeCode); List<ProgramProduct> getNonFullSupplyProductsForProgram(Program program); List<ProgramProduct> searchByProgram(String searchParam, Pagination pagination); Integer getTotalSearchResultCount(String searchParam); List<ProgramProduct> searchByProduct(String searchParam, Pagination pagination); List<ProgramProduct> getActiveByProgram(Long programId); @Transactional void insertISA(ProgramProductISA programProductISA); void updateISA(ProgramProductISA programProductISA);  }