Examples of Attachment


Examples of org.cedj.geekseek.domain.attachment.model.Attachment

    // Story: As a User I should be able to update an Attachment

    @Test
    public void shouldBeAbleToUpdateAttachment() throws Exception {
        String updatedTitle = "Test 2";
        Attachment attachment = createAttachment();
        attachment = repository.store(attachment);

        attachment = attachment.setTitle(updatedTitle);
        attachment = repository.store(attachment);

        Attachment updated = repository.get(attachment.getId());

        Assert.assertEquals(updated.getTitle(), updatedTitle);
        Assert.assertNotNull(attachment.getLastUpdated());
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

public class AttachmentValidationTestCase extends TimestampableSpecification<Attachment> {

    @Override
    protected Attachment createInstance() throws Exception {
        return new Attachment("", "", new URL("http://geekseek.org"));
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

    // Story: As a User I should be able to remove an Attachment

    @Test
    public void shouldBeAbleToRemoveAttachment() throws Exception {
        Attachment attachment = createAttachment();
        attachment = repository.store(attachment);

        repository.remove(attachment);

        Attachment removed = repository.get(attachment.getId());
        Assert.assertNull(removed);
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        update.set(entity, new Date());
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullConstructorTitle() throws Exception {
        new Attachment(null, "", new URL("http://geekseek.org"));
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        new Attachment(null, "", new URL("http://geekseek.org"));
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullConstructorMimeType() throws Exception {
        new Attachment("", null, new URL("http://geekseek.org"));
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

    }

    @Test
    public void shouldNotReflectNonStoredChanges() throws Exception {
        String updatedTitle = "Test Non Stored Changes";
        Attachment attachment = createAttachment();
        String originalTitle = attachment.getTitle();

        Attachment stored = repository.store(attachment);

        // tile change not stored to repository
        stored = stored.setTitle(updatedTitle);

        Attachment refreshed = repository.get(attachment.getId());

        Assert.assertEquals(refreshed.getTitle(), originalTitle);
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        new Attachment("", null, new URL("http://geekseek.org"));
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullConstructorUrl() throws Exception {
        new Attachment("", "", null);
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        new Attachment("", "", null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullSetterTitle() throws Exception {
        Attachment att = new Attachment("", "", new URL("http://geekseek.org"));
        att.setTitle(null);
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        att.setTitle(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullSetterMimeType() throws Exception {
        Attachment att = new Attachment("", "", new URL("http://geekseek.org"));
        att.setMimeType(null);
    }

Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        att.setMimeType(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldNotAllowNullSetterUrl() throws Exception {
        Attachment att = new Attachment("", "", new URL("http://geekseek.org"));
        att.setUrl(null);
    }
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.