@Test public void testGetAllIntegreradEnhet() { IntegreradEnhet enhet1 = new IntegreradEnhet(); enhet1.setEnhetsId("enhetsId1"); IntegreradEnhet enhet2 = new IntegreradEnhet(); enhet2.setEnhetsId("enhetsId2"); List<IntegreradEnhet> list = new ArrayList<>(); list.add(enhet1); list.add(enhet2); when(integreradEnhetRepository.findAll()).thenReturn(list); List<IntegreradEnhet> result = registry.getAllIntegreradEnhet(); assertEquals(result.size(), list.size()); }
@Override @Transactional(readOnly = true) public List<IntegreradEnhet> getAllIntegreradEnhet() { List<IntegreradEnhet> result = new ArrayList<>(); integreradEnhetRepository.findAll().forEach(result::add); return result; }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional(readOnly = true) public List<IntegreradEnhet> getAllIntegreradEnhet() { List<IntegreradEnhet> result = new ArrayList<>(); integreradEnhetRepository.findAll().forEach(result::add); return result; } }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional(readOnly = true) public List<IntegreradEnhet> getAllIntegreradEnhet() { List<IntegreradEnhet> result = new ArrayList<>(); integreradEnhetRepository.findAll().forEach(result::add); return result; }  }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional(readOnly = true) public List<IntegreradEnhet> getAllIntegreradEnhet() { List<IntegreradEnhet> result = new ArrayList<>(); integreradEnhetRepository.findAll().forEach(result::add); return result; }  @Override @Transactional void putIntegreradEnhet(IntegreradEnhetEntry entry, boolean schemaVersion1, boolean schemaVersion3); @Override @Transactional boolean isEnhetIntegrerad(String enhetsHsaId, String intygType); @Override @Transactional(readOnly = true) IntegreradEnhet getIntegreradEnhet(String enhetsId); @Override @Transactional(readOnly = true) List<IntegreradEnhet> getAllIntegreradEnhet(); @Override @Transactional void addIfSameVardgivareButDifferentUnits(String orgEnhetsHsaId, IntegreradEnhetEntry newEntry, String intygType); @Override @Transactional void deleteIntegreradEnhet(String enhetsHsaId); @Override @Transactional Optional<SchemaVersion> getSchemaVersion(String enhetsHsaId, String intygType); @Override @Transactional(readOnly = true) List<IntegreradEnhetEntryWithSchemaVersion> getIntegreradeVardenheter(); }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional(readOnly = true) public List<IntegreradEnhet> getAllIntegreradEnhet() { List<IntegreradEnhet> result = new ArrayList<>(); integreradEnhetRepository.findAll().forEach(result::add); return result; }  @Override @Transactional void putIntegreradEnhet(IntegreradEnhetEntry entry, boolean schemaVersion1, boolean schemaVersion3); @Override @Transactional boolean isEnhetIntegrerad(String enhetsHsaId, String intygType); @Override @Transactional(readOnly = true) IntegreradEnhet getIntegreradEnhet(String enhetsId); @Override @Transactional(readOnly = true) List<IntegreradEnhet> getAllIntegreradEnhet(); @Override @Transactional void addIfSameVardgivareButDifferentUnits(String orgEnhetsHsaId, IntegreradEnhetEntry newEntry, String intygType); @Override @Transactional void deleteIntegreradEnhet(String enhetsHsaId); @Override @Transactional Optional<SchemaVersion> getSchemaVersion(String enhetsHsaId, String intygType); @Override @Transactional(readOnly = true) List<IntegreradEnhetEntryWithSchemaVersion> getIntegreradeVardenheter();  }