### Question:
AttachmentFileManager { public DataStorageStreamingContent downloadAttachment(long attachmentId) { String systemDataStorageName = preferenceManager.getPreference( SystemPreferences.DATA_STORAGE_SYSTEM_DATA_STORAGE_NAME); Assert.notNull(systemDataStorageName, messageHelper.getMessage( MessageConstants.ERROR_ATTACHMENT_SYSTEM_DATA_STORAGE_NOT_CONFIGURED)); AbstractDataStorage attachmentStorage = dataStorageManager.loadByNameOrId(systemDataStorageName); Attachment attachment = attachmentManager.load(attachmentId); DataStorageStreamingContent content = dataStorageManager.getStreamingContent(attachmentStorage.getId(), attachment.getPath(), null); return new DataStorageStreamingContent(content.getContent(), attachment.getName()); } @Autowired  AttachmentFileManager(DataStorageManager dataStorageManager, PreferenceManager preferenceManager,
                                 AttachmentManager attachmentManager, MessageHelper messageHelper,
                                 AuthManager authManager); Attachment uploadAttachment(InputStream attachmentInputStream, String fileName); DataStorageStreamingContent downloadAttachment(long attachmentId); void deleteAttachments(List<Attachment> attachments); @Transactional(propagation = Propagation.REQUIRED) void deleteAttachment(long attachmentId);  }### Answer:
@Test public void testDownloadAttachment() { DataStorageStreamingContent content = attachmentFileManager.downloadAttachment(1L); Assert.assertNotNull(content.getContent()); Assert.assertEquals(TEST_ATTACHMENT_NAME, content.getName()); verify(dataStorageManager).loadByNameOrId(TEST_SYSTEM_DATA_STORAGE); verify(attachmentManager).load(1L); verify(dataStorageManager).getStreamingContent(testSystemDataStorage.getId(), TEST_ATTACHMENT_PATH, null); }