@Test public void shouldGetProgramProductById() { ProgramProduct expectedProgramProduct = new ProgramProduct(); when(programProductMapper.getById(2L)).thenReturn(expectedProgramProduct); ProgramProduct programProduct = programProductRepository.getById(2L); verify(programProductMapper).getById(2L); assertThat(programProduct, is(expectedProgramProduct)); }
public ProgramProduct getById(Long id) { return mapper.getById(id); }
ProgramProductRepository { public ProgramProduct getById(Long id) { return mapper.getById(id); } }
ProgramProductRepository { public ProgramProduct getById(Long id) { return mapper.getById(id); }  }
ProgramProductRepository { public ProgramProduct getById(Long id) { return mapper.getById(id); }  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 ProgramProduct getById(Long id) { return mapper.getById(id); }  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);  }