public void testConstructorWithCaptionAndData() { Attachment attachment = new Attachment(CAPTION, DATA); assertEquals(ElementType.ATTACHMENT, attachment.getType()); assertEquals(CAPTION, attachment.getCaption()); assertEquals(DATA, attachment.getData()); }
try { attachment.setProperty(Attachment.ATTACHMENT_ID, "attachment1"); fail("Should have thrown exception when trying to set attachment id."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set mime type."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set attachment url."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set data."); } catch (IllegalArgumentException e) { assertEquals("new caption", attachment.getCaption());
try { attachment.setProperty(Attachment.ATTACHMENT_ID, "attachment1"); fail("Should have thrown exception when trying to set attachment id."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set mime type."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set attachment url."); } catch (IllegalArgumentException e) { fail("Should have thrown exception when trying to set data."); } catch (IllegalArgumentException e) { assertEquals("new caption", attachment.getCaption());
public void testConstructorWithCaptionAndData() { Attachment attachment = new Attachment(CAPTION, DATA); assertEquals(ElementType.ATTACHMENT, attachment.getType()); assertEquals(CAPTION, attachment.getCaption()); assertEquals(DATA, attachment.getData()); }