@Test public void fromXAttachmentIsCorrect() throws ComponentLookupException, IOException { Attachment result = this.mocker.getComponentUnderTest().fromXWikiAttachment(this.attachment1); Assert.assertNotNull(result); Assert.assertEquals("a1.pdf", result.getFilename()); Assert.assertEquals(4, result.getFilesize()); Assert.assertEquals(this.author1, result.getAuthorReference()); Assert.assertEquals(this.date1, result.getDate()); Assert.assertEquals("abcd", IOUtils.toString(result.getContent(), StandardCharsets.US_ASCII)); Assert.assertTrue(result.getAllAttributes().isEmpty()); }
public Attachment fromXWikiAttachment(XWikiAttachment attachment) { if (attachment == null) { return null; } return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); }
AttachmentAdapterFactory { public Attachment fromXWikiAttachment(XWikiAttachment attachment) { if (attachment == null) { return null; } return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } }
AttachmentAdapterFactory { public Attachment fromXWikiAttachment(XWikiAttachment attachment) { if (attachment == null) { return null; } return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); }  }
AttachmentAdapterFactory { public Attachment fromXWikiAttachment(XWikiAttachment attachment) { if (attachment == null) { return null; } return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); }  Attachment fromXWikiAttachment(XWikiAttachment attachment); Attachment fromJSON(JSONObject attachment); }
AttachmentAdapterFactory { public Attachment fromXWikiAttachment(XWikiAttachment attachment) { if (attachment == null) { return null; } return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); }  Attachment fromXWikiAttachment(XWikiAttachment attachment); Attachment fromJSON(JSONObject attachment);  }