PayService { @Transactional public void update(Long id, String tradeNo) { Pay pay = payRepository.getOne(id); pay.changeTradeNo(tradeNo); }  void updateNative(Long id, String tradeNo); @Transactional void update(Long id, String tradeNo);  }
@Test public void SpringDataJpa로_확인() { Pay pay = payRepository.save(new Pay("test1", 100)); String updateTradeNo = "test2"; payService.update(pay.getId(), updateTradeNo); Pay saved = payRepository.findAll().get(0); assertThat(saved.getTradeNo()).isEqualTo(updateTradeNo); }