### Question:
FilesystemAttachmentStore implements XWikiAttachmentStoreInterface { @Override public void saveAttachmentContent(final XWikiAttachment attachment, final XWikiContext context, final boolean bTransaction) throws XWikiException { this.saveAttachmentContent(attachment, true, context, bTransaction); }  @Override String getHint(); @Override void saveAttachmentContent(final XWikiAttachment attachment, final XWikiContext context,
        final boolean bTransaction); @Override void saveAttachmentContent(final XWikiAttachment attachment, final boolean updateDocument,
        final XWikiContext context, final boolean bTransaction); @Override void saveAttachmentsContent(final List<XWikiAttachment> attachments, final XWikiDocument doc,
        final boolean updateDocument, final XWikiContext context, final boolean bTransaction); @Override void loadAttachmentContent(final XWikiAttachment attachment, final XWikiContext context,
        final boolean bTransaction); @Override void deleteXWikiAttachment(final XWikiAttachment attachment, final XWikiContext context,
        final boolean bTransaction); @Override void deleteXWikiAttachment(final XWikiAttachment attachment, final boolean parentUpdate,
        final XWikiContext context, final boolean bTransaction); @Override void cleanUp(XWikiContext context);  }### Answer:
@Test public void saveContentTest() throws Exception { final File storeFile = this.fileTools.getAttachmentFileProvider(this.mockAttachReference).getAttachmentContentFile(); Assert.assertFalse(this.storeFile.exists()); getMockery().checking(new Expectations() { { oneOf(mockAttachVersionStore).saveArchive(mockArchive, mockContext, false); } }); this.attachStore.saveAttachmentContent(this.mockAttach, false, this.mockContext, false); Assert.assertTrue("The attachment file was not created.", this.storeFile.exists()); Assert.assertEquals("The attachment file contained the wrong content", HELLO, FileUtils.readFileToString(storeFile, StandardCharsets.UTF_8)); }
@Test public void documentUpdateOnSaveTest() throws Exception { getMockery().checking(new Expectations() { { oneOf(mockHibernate).saveXWikiDoc(doc, mockContext, false); oneOf(mockAttachVersionStore).saveArchive(mockArchive, mockContext, false); } }); this.attachStore.saveAttachmentContent(this.mockAttach, true, this.mockContext, false); }