@Test public void test_update() { InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); InstrumentVoucher expectedResult = entity.toDomain(); when(instrumentVoucherJdbcRepository.update(any(InstrumentVoucherEntity.class))).thenReturn(entity); InstrumentVoucher actualResult = instrumentVoucherRepository.update(getInstrumentVoucherDomin()); assertEquals(expectedResult.getVoucherHeaderId(), actualResult.getVoucherHeaderId()); assertEquals(expectedResult.getInstrument().getId(), actualResult.getInstrument().getId()); }
@Transactional public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); return entity.toDomain(); }
InstrumentVoucherRepository { @Transactional public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); return entity.toDomain(); } }
InstrumentVoucherRepository { @Transactional public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); return entity.toDomain(); }  }
InstrumentVoucherRepository { @Transactional public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); return entity.toDomain(); }  InstrumentVoucher findById(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher save(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher update(InstrumentVoucher instrumentVoucher); }
InstrumentVoucherRepository { @Transactional public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); return entity.toDomain(); }  InstrumentVoucher findById(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher save(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher update(InstrumentVoucher instrumentVoucher);  }