public void testConstructorWithCaptionAndData() { Attachment attachment = new Attachment(CAPTION, DATA); assertEquals(ElementType.ATTACHMENT, attachment.getType()); assertEquals(CAPTION, attachment.getCaption()); assertEquals(DATA, attachment.getData()); }
public void testConstructorWithCaptionAndData() { Attachment attachment = new Attachment(CAPTION, DATA); assertEquals(ElementType.ATTACHMENT, attachment.getType()); assertEquals(CAPTION, attachment.getCaption()); assertEquals(DATA, attachment.getData()); }
public void testAttachmentSerialization() { convertBackAndForth("<image attachment=\"id\"></image>"); convertBackAndForth("<image attachment=\"id\"><caption>caption</caption></image>"); Element element = createApiElementFromXml( "<image attachment=\"id\"><gadge>something</gadge>" + "<caption>caption</caption><fake>fake</fake></image>", createWavelet("id")); assertTrue(element instanceof Attachment); assertEquals("caption", ((Attachment) element).getCaption()); assertEquals("id", ((Attachment) element).getAttachmentId()); assertEquals(ATTACHMENT_MIMETYPE, ((Attachment) element).getMimeType()); assertEquals(ATTACHMENT_URL, ((Attachment) element).getAttachmentUrl()); }
public void testAttachmentSerialization() { convertBackAndForth("<image attachment=\"id\"></image>"); convertBackAndForth("<image attachment=\"id\"><caption>caption</caption></image>"); Element element = createApiElementFromXml( "<image attachment=\"id\"><gadge>something</gadge>" + "<caption>caption</caption><fake>fake</fake></image>", createWavelet("id")); assertTrue(element instanceof Attachment); assertEquals("caption", ((Attachment) element).getCaption()); assertEquals("id", ((Attachment) element).getAttachmentId()); assertEquals(ATTACHMENT_MIMETYPE, ((Attachment) element).getMimeType()); assertEquals(ATTACHMENT_URL, ((Attachment) element).getAttachmentUrl()); }
assertEquals("new caption", attachment.getCaption());
assertEquals("new caption", attachment.getCaption());