@Test void testDeleteByIdUnknownId() { Attribute idAttribute = when(mock(Attribute.class).getName()).thenReturn("idAttribute").getMock(); EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("sys_file_FileMeta").getMock(); when(entityType.getIdAttribute()).thenReturn(idAttribute); when(delegateRepository.getEntityType()).thenReturn(entityType); when(delegateRepository.findOneById("id")).thenReturn(null); Exception exception = assertThrows( UnknownEntityException.class, () -> fileMetaRepositoryDecorator.deleteById("id")); assertThat(exception.getMessage()) .containsPattern("type:sys_file_FileMeta id:id attribute:idAttribute"); }
@Override public void deleteById(Object id) { deleteFile(getFileMeta(id)); super.deleteById(id); }
FileMetaRepositoryDecorator extends AbstractRepositoryDecorator<FileMeta> { @Override public void deleteById(Object id) { deleteFile(getFileMeta(id)); super.deleteById(id); } }
FileMetaRepositoryDecorator extends AbstractRepositoryDecorator<FileMeta> { @Override public void deleteById(Object id) { deleteFile(getFileMeta(id)); super.deleteById(id); } FileMetaRepositoryDecorator(
      Repository<FileMeta> delegateRepository, FileStore fileStore, BlobStore blobStore); }
FileMetaRepositoryDecorator extends AbstractRepositoryDecorator<FileMeta> { @Override public void deleteById(Object id) { deleteFile(getFileMeta(id)); super.deleteById(id); } FileMetaRepositoryDecorator(
      Repository<FileMeta> delegateRepository, FileStore fileStore, BlobStore blobStore); @Override void delete(FileMeta fileMeta); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<FileMeta> fileMetaStream); @Override void deleteAll(Stream<Object> ids); }
FileMetaRepositoryDecorator extends AbstractRepositoryDecorator<FileMeta> { @Override public void deleteById(Object id) { deleteFile(getFileMeta(id)); super.deleteById(id); } FileMetaRepositoryDecorator(
      Repository<FileMeta> delegateRepository, FileStore fileStore, BlobStore blobStore); @Override void delete(FileMeta fileMeta); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<FileMeta> fileMetaStream); @Override void deleteAll(Stream<Object> ids);  }