ReceiverService { @Transactional public Receiver updateAddress(long id, Address address) { final Receiver receiver = findById(id); receiver.updateAddress(address); return receiver; } @Builder  ReceiverService(ReceiverRepository receiverRepository); @Transactional(readOnly = true) Receiver findById(long id); @Transactional Receiver create(Receiver receiver); @Transactional Receiver updateAddress(long id, Address address);  }
@Test public void updateAddress() { final Receiver receiver = buildReceiver("서울"); final Address newAddress = buildAddress("부산"); given(receiverRepository.findOne(anyLong())).willReturn(receiver); final Receiver updateAddress = receiverService.updateAddress(anyLong(), newAddress); System.out.println(updateAddress); }