BookService { @Transactional public void update (Long bookId, String bookName) { Book book = bookQueryRepository.getBookById(bookId); book.changeName(bookName); }  @Transactional void update(Long bookId, String bookName); @Transactional void backup(Long bookId);  }
@Test void test_트랜잭션() throws Exception { Long bookId = bookRepository.save(Book.builder() .name("a") .build()) .getId(); String result = "b"; bookService.update(bookId, result); Book book = bookRepository.findById(bookId).get(); assertThat(book.getName()).isEqualTo(result); }