@Test public void test_find_by_id() { InstrumentTypePropertyEntity entity = getInstrumentTypePropertyEntity(); InstrumentTypeProperty expectedResult = entity.toDomain(); when(instrumentTypePropertyJdbcRepository.findById(any(InstrumentTypePropertyEntity.class))).thenReturn(entity); InstrumentTypeProperty actualResult = instrumentTypePropertyRepository .findById(getInstrumentTypePropertyDomin()); assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); assertEquals(expectedResult.getReconciledOncreate(), actualResult.getReconciledOncreate()); assertEquals(expectedResult.getStatusOnCreate().getId(), actualResult.getStatusOnCreate().getId()); assertEquals(expectedResult.getStatusOnReconcile().getId(), actualResult.getStatusOnReconcile().getId()); assertEquals(expectedResult.getStatusOnUpdate().getId(), actualResult.getStatusOnUpdate().getId()); }
public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); if (entity != null) return entity.toDomain(); return null; }
InstrumentTypePropertyRepository { public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); if (entity != null) return entity.toDomain(); return null; } }
InstrumentTypePropertyRepository { public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); if (entity != null) return entity.toDomain(); return null; }  }
InstrumentTypePropertyRepository { public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); if (entity != null) return entity.toDomain(); return null; }  InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty); @Transactional InstrumentTypeProperty save(InstrumentTypeProperty instrumentTypeProperty); @Transactional InstrumentTypeProperty update(InstrumentTypeProperty instrumentTypeProperty); }
InstrumentTypePropertyRepository { public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); if (entity != null) return entity.toDomain(); return null; }  InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty); @Transactional InstrumentTypeProperty save(InstrumentTypeProperty instrumentTypeProperty); @Transactional InstrumentTypeProperty update(InstrumentTypeProperty instrumentTypeProperty);  }