@Test public void test_find_by_id_return_null() { InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); when(instrumentVoucherJdbcRepository.findById(null)).thenReturn(entity); InstrumentVoucher actualResult = instrumentVoucherRepository.findById(getInstrumentVoucherDomin()); assertEquals(null, actualResult); }
public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); if (entity != null) return entity.toDomain(); return null; }
InstrumentVoucherRepository { public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); if (entity != null) return entity.toDomain(); return null; } }
InstrumentVoucherRepository { public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); if (entity != null) return entity.toDomain(); return null; }  }
InstrumentVoucherRepository { public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); if (entity != null) return entity.toDomain(); return null; }  InstrumentVoucher findById(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher save(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher update(InstrumentVoucher instrumentVoucher); }
InstrumentVoucherRepository { public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); if (entity != null) return entity.toDomain(); return null; }  InstrumentVoucher findById(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher save(InstrumentVoucher instrumentVoucher); @Transactional InstrumentVoucher update(InstrumentVoucher instrumentVoucher);  }