Package org.mongolink.test.entity

Examples of org.mongolink.test.entity.Comment


    @Test
    public void canSerializeToDBOject() throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
        final BasicDBObject into = new BasicDBObject();
        FakeAggregate entity = new FakeAggregate("te");
        final Comment comment = new Comment("tes");
        entity.setComment(comment);

        propertyMapperForComponent().save(entity, into);

        final BasicDBObject commentDB = (BasicDBObject) into.get("comment");
View Full Code Here


        mapper = (ComponentMapper<Comment>) context.mapperFor(Comment.class);
    }

    @Test
    public void canSaveProperties() {
        Comment comment = new Comment("the value");

        DBObject dbo = mapper.toDBObject(comment);

        Assert.assertThat(dbo, Matchers.notNullValue());
        Assert.assertThat(dbo.get("value"), Matchers.is((Object) "the value"));
View Full Code Here

    @Test
    public void canPopulateProperties() {
        DBObject dbo = new BasicDBObject();
        dbo.put("value", "this is mongolink!");

        Comment entity = mapper.toInstance(dbo);

        Assert.assertThat(entity, Matchers.notNullValue());
        Assert.assertThat(entity.getValue(), Matchers.is("this is mongolink!"));
    }
View Full Code Here

TOP

Related Classes of org.mongolink.test.entity.Comment

Copyright © 2018 www.massapicom. 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.