@Test void testGetFileMetaUnknown() { String fileId = "MyFileId"; assertThrows(UnknownEntityException.class, () -> filesApiServiceImpl.getFileMeta(fileId)); }
@Transactional(readOnly = true) @Override public FileMeta getFileMeta(String fileId) { FileMeta fileMeta = dataService.findOneById(FILE_META, fileId, FileMeta.class); if (fileMeta == null) { throw new UnknownEntityException(FILE_META, fileId); } return fileMeta; }
FilesServiceImpl implements FilesService { @Transactional(readOnly = true) @Override public FileMeta getFileMeta(String fileId) { FileMeta fileMeta = dataService.findOneById(FILE_META, fileId, FileMeta.class); if (fileMeta == null) { throw new UnknownEntityException(FILE_META, fileId); } return fileMeta; } }
FilesServiceImpl implements FilesService { @Transactional(readOnly = true) @Override public FileMeta getFileMeta(String fileId) { FileMeta fileMeta = dataService.findOneById(FILE_META, fileId, FileMeta.class); if (fileMeta == null) { throw new UnknownEntityException(FILE_META, fileId); } return fileMeta; } FilesServiceImpl(DataService dataService, BlobStore blobStore, FileMetaFactory fileMetaFactory); }
FilesServiceImpl implements FilesService { @Transactional(readOnly = true) @Override public FileMeta getFileMeta(String fileId) { FileMeta fileMeta = dataService.findOneById(FILE_META, fileId, FileMeta.class); if (fileMeta == null) { throw new UnknownEntityException(FILE_META, fileId); } return fileMeta; } FilesServiceImpl(DataService dataService, BlobStore blobStore, FileMetaFactory fileMetaFactory); @Transactional(readOnly = true) @Override FileMeta getFileMeta(String fileId); @Override void delete(String fileId); @Transactional @Override CompletableFuture<FileMeta> upload(HttpServletRequest httpServletRequest); @Transactional(readOnly = true) @Override ResponseEntity<StreamingResponseBody> download(String fileId); }
FilesServiceImpl implements FilesService { @Transactional(readOnly = true) @Override public FileMeta getFileMeta(String fileId) { FileMeta fileMeta = dataService.findOneById(FILE_META, fileId, FileMeta.class); if (fileMeta == null) { throw new UnknownEntityException(FILE_META, fileId); } return fileMeta; } FilesServiceImpl(DataService dataService, BlobStore blobStore, FileMetaFactory fileMetaFactory); @Transactional(readOnly = true) @Override FileMeta getFileMeta(String fileId); @Override void delete(String fileId); @Transactional @Override CompletableFuture<FileMeta> upload(HttpServletRequest httpServletRequest); @Transactional(readOnly = true) @Override ResponseEntity<StreamingResponseBody> download(String fileId);  }