@Test public void testDeleteIntegreradEnhetNotFound() { final String enhetsId = "enhetsId"; when(integreradEnhetRepository.findById(enhetsId)).thenReturn(Optional.empty()); registry.deleteIntegreradEnhet(enhetsId); verify(integreradEnhetRepository, never()).delete(any(IntegreradEnhet.class)); }
@Override @Transactional public void deleteIntegreradEnhet(String enhetsHsaId) { IntegreradEnhet unit = integreradEnhetRepository.findById(enhetsHsaId).orElse(null); if (unit != null) { integreradEnhetRepository.delete(unit); LOG.debug("IntegreradEnhet {} deleted", enhetsHsaId); } }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional public void deleteIntegreradEnhet(String enhetsHsaId) { IntegreradEnhet unit = integreradEnhetRepository.findById(enhetsHsaId).orElse(null); if (unit != null) { integreradEnhetRepository.delete(unit); LOG.debug("IntegreradEnhet {} deleted", enhetsHsaId); } } }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional public void deleteIntegreradEnhet(String enhetsHsaId) { IntegreradEnhet unit = integreradEnhetRepository.findById(enhetsHsaId).orElse(null); if (unit != null) { integreradEnhetRepository.delete(unit); LOG.debug("IntegreradEnhet {} deleted", enhetsHsaId); } }  }
IntegreradeEnheterRegistryImpl implements IntegreradeEnheterRegistry { @Override @Transactional public void deleteIntegreradEnhet(String enhetsHsaId) { IntegreradEnhet unit = integreradEnhetRepository.findById(enhetsHsaId).orElse(null); if (unit != null) { integreradEnhetRepository.delete(unit); LOG.debug("IntegreradEnhet {} deleted", enhetsHsaId); } }  @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 public void deleteIntegreradEnhet(String enhetsHsaId) { IntegreradEnhet unit = integreradEnhetRepository.findById(enhetsHsaId).orElse(null); if (unit != null) { integreradEnhetRepository.delete(unit); LOG.debug("IntegreradEnhet {} deleted", enhetsHsaId); } }  @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();  }